/* #000101 */

/* ===== COLOR SYSTEM - Design Tokens ===== */

/* Base Brand Colors */
:root {
    /* Primary - Violet Purple */
    --color-primary: #7C5CFF;
    --color-primary-hover: #6f53e6;
    --color-primary-light: rgba(124, 92, 255, 0.1);
    --color-primary-dark: #694ed9;
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-light: rgba(16, 185, 129, 0.15);
    --color-success-dark: #059669;
    
    --color-warning: #f59e0b;
    --color-warning-light: rgba(245, 158, 11, 0.15);
    --color-warning-dark: #d97706;
    
    --color-error: #ef4444;
    --color-error-light: rgba(239, 68, 68, 0.15);
    --color-error-dark: #dc2626;
    
    --color-info: #3b82f6;
    --color-info-light: rgba(59, 130, 246, 0.15);
    
    /* Neutral Colors - Gray Scale */
    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;
    
    /* Category Colors - Unified System */
    --cat-bank: #ef4444;
    --cat-betting: #f97316;
    --cat-cloud: #0ea5e9;
    --cat-crypto: #f59e0b;
    --cat-delivery: #b45309;
    --cat-finance: #22c55e;
    --cat-gaming: #a855f7;
    --cat-insurance: #14b8a6;
    --cat-media: #ec4899;
    --cat-misc: #78716c;
    --cat-services: #6366f1;
    --cat-shop: #10b981;
    --cat-social: #3b82f6;
    --cat-stream: #d946ef;
    --cat-telecommunications: #2563eb;
    --cat-travel: #06b6d4;
    --cat-utilities: #64748b;
    --cat-vpn: #8b5cf6;
    --cat-no-category: #6b7280;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Border Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    --transition-fast: 0.1s ease;
    --transition-slow: 0.3s ease;
    
    /* ===== TYPOGRAPHY SYSTEM - Modular Scale & Design Tokens ===== */
    
    /* Font Family */
    --font-family-sans: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-mono: 'Google Sans Code', 'Fira Code', monospace;
    
    /* Font Size - Modular Scale (1.25 ratio) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.25rem;      /* 20px */
    --font-size-xl: 1.563rem;     /* 25px */
    --font-size-2xl: 1.953rem;    /* 31px */
    --font-size-3xl: 2.441rem;    /* 39px */
    
    /* Font Weight */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Height */
    --line-height-tight: 1.2;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
}

/* ===== LIGHT THEME (Default) ===== */
[data-theme="light"] {
    /* Backgrounds - Optimized for readability */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    /* Text Colors - High contrast */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-placeholder: #94a3b8;
    
    /* Borders */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    
    /* Semantic Backgrounds */
    --bg-success: rgba(16, 185, 129, 0.1);
    --bg-warning: rgba(245, 158, 11, 0.1);
    --bg-error: rgba(239, 68, 68, 0.1);
    
    /* Component Colors */
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --primary-light: #eef2ff;
    
    /* Shadows - Softer for light mode */
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    /* Backgrounds - Better contrast */
    --bg-primary: #1a1a1a;
    --bg-secondary: #141414;
    --bg-tertiary: #202020;
    --bg-hover: #2a2a2a;
    
    /* Text Colors - Readable contrast */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-placeholder: #64748b;
    
    /* Borders - Visible but not harsh */
    --border: #333333;
    --border-strong: #404040;
    
    /* Semantic Backgrounds */
    --bg-success: rgba(16, 185, 129, 0.2);
    --bg-warning: rgba(245, 158, 11, 0.2);
    --bg-error: rgba(239, 68, 68, 0.2);
    
    /* Component Colors */
    --card-bg: #1a1a1a;
    --input-bg: #202020;
    --primary-light: rgba(124, 92, 255, 0.2);
    
    /* Shadows - Lighter for dark mode */
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* ===== ALIAS CATEGORY COLOR MAPPING ===== */
/* Category colors with CSS custom properties for consistency */
[data-theme="light"] {
    --cat-bank-bg: rgba(239, 68, 68, 0.15);
    --cat-bank-text: #dc2626;
    --cat-betting-bg: rgba(249, 115, 22, 0.15);
    --cat-betting-text: #ea580c;
    --cat-cloud-bg: rgba(14, 165, 233, 0.15);
    --cat-cloud-text: #0284c7;
    --cat-crypto-bg: rgba(245, 158, 11, 0.15);
    --cat-crypto-text: #d97706;
    --cat-delivery-bg: rgba(180, 83, 9, 0.15);
    --cat-delivery-text: #b45309;
    --cat-finance-bg: rgba(34, 197, 94, 0.15);
    --cat-finance-text: #16a34a;
    --cat-gaming-bg: rgba(168, 85, 247, 0.15);
    --cat-gaming-text: #9333ea;
    --cat-insurance-bg: rgba(20, 184, 166, 0.15);
    --cat-insurance-text: #0d9488;
    --cat-media-bg: rgba(236, 72, 153, 0.15);
    --cat-media-text: #db2777;
    --cat-misc-bg: rgba(120, 113, 108, 0.15);
    --cat-misc-text: #78716c;
    --cat-services-bg: rgba(124, 92, 255, 0.15);
    --cat-services-text: #7C5CFF;
    --cat-shop-bg: rgba(16, 185, 129, 0.15);
    --cat-shop-text: #059669;
    --cat-social-bg: rgba(59, 130, 246, 0.15);
    --cat-social-text: #2563eb;
    --cat-stream-bg: rgba(217, 70, 239, 0.15);
    --cat-stream-text: #c026d3;
    --cat-telecommunications-bg: rgba(37, 99, 235, 0.15);
    --cat-telecommunications-text: #1d4ed8;
    --cat-travel-bg: rgba(6, 182, 212, 0.15);
    --cat-travel-text: #0891b2;
    --cat-utilities-bg: rgba(100, 116, 139, 0.15);
    --cat-utilities-text: #475569;
    --cat-vpn-bg: rgba(139, 92, 246, 0.25);
    --cat-vpn-text: #7c3aed;
    --cat-no-category-bg: rgba(107, 114, 128, 0.15);
    --cat-no-category-text: #6b7280;
}

[data-theme="dark"] {
    --cat-bank-bg: rgba(239, 68, 68, 0.25);
    --cat-bank-text: #f87171;
    --cat-betting-bg: rgba(249, 115, 22, 0.25);
    --cat-betting-text: #fb923c;
    --cat-cloud-bg: rgba(14, 165, 233, 0.25);
    --cat-cloud-text: #38bdf8;
    --cat-crypto-bg: rgba(245, 158, 11, 0.25);
    --cat-crypto-text: #fbbf24;
    --cat-delivery-bg: rgba(180, 83, 9, 0.25);
    --cat-delivery-text: #d97706;
    --cat-finance-bg: rgba(34, 197, 94, 0.25);
    --cat-finance-text: #4ade80;
    --cat-gaming-bg: rgba(168, 85, 247, 0.25);
    --cat-gaming-text: #c084fc;
    --cat-insurance-bg: rgba(20, 184, 166, 0.25);
    --cat-insurance-text: #2dd4bf;
    --cat-media-bg: rgba(236, 72, 153, 0.25);
    --cat-media-text: #f472b6;
    --cat-misc-bg: rgba(120, 113, 108, 0.2);
    --cat-misc-text: #d6d3d1;
    --cat-services-bg: rgba(124, 92, 255, 0.25);
    --cat-services-text: #b3a6ff;
    --cat-shop-bg: rgba(16, 185, 129, 0.25);
    --cat-shop-text: #34d399;
    --cat-social-bg: rgba(59, 130, 246, 0.25);
    --cat-social-text: #60a5fa;
    --cat-stream-bg: rgba(217, 70, 239, 0.25);
    --cat-stream-text: #e879f9;
    --cat-telecommunications-bg: rgba(37, 99, 235, 0.25);
    --cat-telecommunications-text: #3b82f6;
    --cat-travel-bg: rgba(6, 182, 212, 0.25);
    --cat-travel-text: #22d3ee;
    --cat-utilities-bg: rgba(100, 116, 139, 0.25);
    --cat-utilities-text: #cbd5e1;
    --cat-vpn-bg: rgba(139, 92, 246, 0.25);
    --cat-vpn-text: #a78bfa;
    --cat-no-category-bg: rgba(107, 114, 128, 0.25);
    --cat-no-category-text: #d1d5db;
}

/* ===== SYNC STATUS COLORS ===== */
[data-theme="light"] {
    --sync-synced-bg: rgba(16, 185, 129, 0.15);
    --sync-synced-text: #059669;
    --sync-pending-bg: rgba(245, 158, 11, 0.15);
    --sync-pending-text: #d97706;
    --sync-conflict-bg: rgba(239, 68, 68, 0.15);
    --sync-conflict-text: #dc2626;
}

[data-theme="dark"] {
    --sync-synced-bg: rgba(16, 185, 129, 0.2);
    --sync-synced-text: #34d399;
    --sync-pending-bg: rgba(245, 158, 11, 0.2);
    --sync-pending-text: #fbbf24;
    --sync-conflict-bg: rgba(239, 68, 68, 0.2);
    --sync-conflict-text: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

html {
    overflow-y: scroll;
}

body {
    font-family: var(--font-family-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: var(--line-height-relaxed);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
}

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    will-change: transform;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: 4px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    background: var(--color-primary);
    color: white;
}

.sidebar-nav-link svg {
    width: 20px;
    height: 20px;
}

.sidebar-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 16px;
    margin-bottom: 8px;
}

/* ===== SIDEBAR VERSION ===== */
.sidebar-version {
    margin-top: 24px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.version-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-number {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'Google Sans Code', 'Fira Code', monospace !important;
}

.alias-email,
.alias-email-text,
.result-email-text,
.popup-alias-email,
.email-detail-email,
.email-preview-text {
    font-family: 'Google Sans Code', 'Fira Code', monospace !important;
}

/* ===== MAIN CONTENT ===== */
.content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: calc(100vw - 260px);
}

.page {
    display: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
}

.page.active {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    background: transparent;
    border-bottom: none;
    padding: 0 0 24px 0;
    position: static;
    z-index: 100;
    transition: background 0.15s ease, border-color 0.15s ease;
    margin: 0;
    border-radius: 0;
}

.header-content {
    max-width: 1780px;
    margin: 0 auto;
    position: relative;
    height: 56px;
    width: 100%;
    display: flex;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    z-index: 10;
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--color-primary);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    will-change: opacity;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0;
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 15px;
}

/* ===== HEADER ACTIONS - Styles moved to unified section below ===== */

/* ===== HEADER ACTION BUTTONS - Unified Style ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle - Unified with other buttons */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    height: 40px;
}

.theme-toggle:hover {
    border-color: var(--color-primary);
}

.theme-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.theme-btn.active {
    background: var(--color-primary);
    color: white;
}

.theme-btn svg {
    width: 16px;
    height: 16px;
}

/* Backup Button - Unified */
.btn-backup {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    height: 40px;
}

.btn-backup:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--color-primary);
}

.btn-backup svg {
    width: 16px;
    height: 16px;
}

/* Create Button - Unified */
.btn-create {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    height: 40px;
}

.btn-create:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-create svg {
    width: 16px;
    height: 16px;
}

/* Refresh/Sync Button */
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    height: 40px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--color-primary);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

/* ===== SEARCH BOX ===== */
.search-box input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.search-box input::placeholder {
    color: var(--text-placeholder);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-search {
    flex: 1;
    min-width: 250px;
}

.filter-search input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
}

.filter-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.filter-search input::placeholder {
    color: var(--text-placeholder);
}

.filter-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px;
    min-width: 140px;
    transition: var(--transition);
    /* Fix for emoji alignment */
    line-height: 1.4;
    vertical-align: middle;
    max-width: 100%;
}

.filter-select option {
    padding: 10px 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    /* Ensure text is centered vertically */
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    transition: var(--transition);
}

.stat-item.clickable {
    cursor: pointer;
    border: 1px solid transparent;
}

.stat-item.clickable:hover {
    background: var(--bg-hover);
    border-color: var(--color-primary);
}

.stat-item.clickable.active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.stat-item.clickable.active .stat-value {
    color: var(--color-primary);
}

.stat-item.clickable.active .stat-label {
    color: var(--color-primary);
}

/* Category stat active states - matching alias-email and alias-category badge colors */
.stat-item.category-stat.active {
    background: rgba(124, 92, 255, 0.1);
    border-color: rgba(124, 92, 255, 0.3);
    color: var(--color-primary);
}

.stat-item.category-stat.active .stat-value,
.stat-item.category-stat.active .stat-label {
    color: var(--color-primary);
}

/* Category-specific active states using ID selectors */
.stat-item.category-stat#statCategoryBank.active { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.stat-item.category-stat#statCategoryBank.active .stat-value,
.stat-item.category-stat#statCategoryBank.active .stat-label { color: #f87171; }

.stat-item.category-stat#statCategoryBetting.active { background: rgba(249, 115, 22, 0.2); border-color: rgba(249, 115, 22, 0.3); color: #fb923c; }
.stat-item.category-stat#statCategoryBetting.active .stat-value,
.stat-item.category-stat#statCategoryBetting.active .stat-label { color: #fb923c; }

.stat-item.category-stat#statCategoryCloud.active { background: rgba(14, 165, 233, 0.2); border-color: rgba(14, 165, 233, 0.3); color: #38bdf8; }
.stat-item.category-stat#statCategoryCloud.active .stat-value,
.stat-item.category-stat#statCategoryCloud.active .stat-label { color: #38bdf8; }

.stat-item.category-stat#statCategoryCrypto.active { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.stat-item.category-stat#statCategoryCrypto.active .stat-value,
.stat-item.category-stat#statCategoryCrypto.active .stat-label { color: #fbbf24; }

.stat-item.category-stat#statCategoryDelivery.active { background: rgba(180, 83, 9, 0.2); border-color: rgba(180, 83, 9, 0.3); color: #d97706; }
.stat-item.category-stat#statCategoryDelivery.active .stat-value,
.stat-item.category-stat#statCategoryDelivery.active .stat-label { color: #d97706; }

.stat-item.category-stat#statCategoryFinance.active { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.3); color: #4ade80; }
.stat-item.category-stat#statCategoryFinance.active .stat-value,
.stat-item.category-stat#statCategoryFinance.active .stat-label { color: #4ade80; }

.stat-item.category-stat#statCategoryGaming.active { background: rgba(168, 85, 247, 0.2); border-color: rgba(168, 85, 247, 0.3); color: #c084fc; }
.stat-item.category-stat#statCategoryGaming.active .stat-value,
.stat-item.category-stat#statCategoryGaming.active .stat-label { color: #c084fc; }

.stat-item.category-stat#statCategoryInsurance.active { background: rgba(20, 184, 166, 0.2); border-color: rgba(20, 184, 166, 0.3); color: #2dd4bf; }
.stat-item.category-stat#statCategoryInsurance.active .stat-value,
.stat-item.category-stat#statCategoryInsurance.active .stat-label { color: #2dd4bf; }

.stat-item.category-stat#statCategoryMedia.active { background: rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.3); color: #f472b6; }
.stat-item.category-stat#statCategoryMedia.active .stat-value,
.stat-item.category-stat#statCategoryMedia.active .stat-label { color: #f472b6; }

.stat-item.category-stat#statCategoryMisc.active { background: rgba(120, 113, 108, 0.2); border-color: rgba(120, 113, 108, 0.3); color: #a8a29e; }
.stat-item.category-stat#statCategoryMisc.active .stat-value,
.stat-item.category-stat#statCategoryMisc.active .stat-label { color: #a8a29e; }

.stat-item.category-stat#statCategoryServices.active { background: rgba(124, 92, 255, 0.2); border-color: rgba(124, 92, 255, 0.3); color: #a99eff; }
.stat-item.category-stat#statCategoryServices.active .stat-value,
.stat-item.category-stat#statCategoryServices.active .stat-label { color: #a78bfa; }

.stat-item.category-stat#statCategoryShop.active { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.stat-item.category-stat#statCategoryShop.active .stat-value,
.stat-item.category-stat#statCategoryShop.active .stat-label { color: #34d399; }

.stat-item.category-stat#statCategorySocial.active { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.stat-item.category-stat#statCategorySocial.active .stat-value,
.stat-item.category-stat#statCategorySocial.active .stat-label { color: #60a5fa; }

.stat-item.category-stat#statCategoryStream.active { background: rgba(217, 70, 239, 0.2); border-color: rgba(217, 70, 239, 0.3); color: #e879f9; }
.stat-item.category-stat#statCategoryStream.active .stat-value,
.stat-item.category-stat#statCategoryStream.active .stat-label { color: #e879f9; }

.stat-item.category-stat#statCategoryTelecommunications.active { background: rgba(37, 99, 235, 0.2); border-color: rgba(37, 99, 235, 0.3); color: #3b82f6; }
.stat-item.category-stat#statCategoryTelecommunications.active .stat-value,
.stat-item.category-stat#statCategoryTelecommunications.active .stat-label { color: #3b82f6; }

.stat-item.category-stat#statCategoryTravel.active { background: rgba(6, 182, 212, 0.2); border-color: rgba(6, 182, 212, 0.3); color: #22d3ee; }
.stat-item.category-stat#statCategoryTravel.active .stat-value,
.stat-item.category-stat#statCategoryTravel.active .stat-label { color: #22d3ee; }

.stat-item.category-stat#statCategoryUtilities.active { background: rgba(100, 116, 139, 0.25); border-color: rgba(100, 116, 139, 0.35); color: #cbd5e1; }
.stat-item.category-stat#statCategoryUtilities.active .stat-value,
.stat-item.category-stat#statCategoryUtilities.active .stat-label { color: #cbd5e1; }

.stat-item.category-stat#statCategoryVpn.active { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.3); color: #a78bfa; }
.stat-item.category-stat#statCategoryVpn.active .stat-value,
.stat-item.category-stat#statCategoryVpn.active .stat-label { color: #a78bfa; }

.stat-item.category-stat#statCategoryNoCategory.active { background: rgba(107, 114, 128, 0.2); border-color: rgba(107, 114, 128, 0.3); color: #9ca3af; }
.stat-item.category-stat#statCategoryNoCategory.active .stat-value,
.stat-item.category-stat#statCategoryNoCategory.active .stat-label { color: #9ca3af; }

.stat-item:hover {
    background: var(--bg-hover);
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-item:first-child .stat-value {
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== ALIAS CARDS GRID ===== */
.aliases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* Virtual Scrolling Container */
.aliases-scroll-container {
    position: relative;
    height: calc(100vh - 280px);
    min-height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Responsive virtual scroll container */
@media (max-width: 900px) {
    .aliases-scroll-container {
        height: calc(100vh - 320px);
        min-height: 350px;
    }
}

@media (max-width: 600px) {
    .aliases-scroll-container {
        height: calc(100vh - 360px);
        min-height: 300px;
    }
}

.virtual-scroll-spacer {
    width: 1px;
    height: 0;
    pointer-events: none;
}

.virtual-scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(0);
}

.virtual-scroll-content .aliases-grid {
    /* Keep grid layout inside virtual scroll */
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.15s ease;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: translateY(0);
}

.back-to-top-btn svg {
    width: 24px;
    height: 24px;
}

/* Responsive back-to-top button */
@media (max-width: 600px) {
    .back-to-top-btn {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
    }
    
    .back-to-top-btn svg {
        width: 20px;
        height: 20px;
    }
}

.alias-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.alias-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}



.alias-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.alias-service {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alias-service-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.3s ease;
}

/* Category-specific icon backgrounds matching badge colors */
.alias-card:has(.alias-category.bank) .alias-service-icon { background: rgba(239, 68, 68, 0.2); }
.alias-card:has(.alias-category.betting) .alias-service-icon { background: rgba(249, 115, 22, 0.2); }
.alias-card:has(.alias-category.cloud) .alias-service-icon { background: rgba(14, 165, 233, 0.2); }
.alias-card:has(.alias-category.crypto) .alias-service-icon { background: rgba(245, 158, 11, 0.2); }
.alias-card:has(.alias-category.delivery) .alias-service-icon { background: rgba(180, 83, 9, 0.2); }
.alias-card:has(.alias-category.finance) .alias-service-icon { background: rgba(34, 197, 94, 0.2); }
.alias-card:has(.alias-category.gaming) .alias-service-icon { background: rgba(168, 85, 247, 0.2); }
.alias-card:has(.alias-category.insurance) .alias-service-icon { background: rgba(20, 184, 166, 0.2); }
.alias-card:has(.alias-category.media) .alias-service-icon { background: rgba(236, 72, 153, 0.2); }
.alias-card:has(.alias-category.misc) .alias-service-icon { background: rgba(168, 162, 158, 0.25); }
.alias-card:has(.alias-category.services) .alias-service-icon { background: rgba(124, 92, 255, 0.2); }
.alias-card:has(.alias-category.shop) .alias-service-icon { background: rgba(16, 185, 129, 0.2); }
.alias-card:has(.alias-category.social) .alias-service-icon { background: rgba(59, 130, 246, 0.2); }
.alias-card:has(.alias-category.stream) .alias-service-icon { background: rgba(217, 70, 239, 0.2); }
.alias-card:has(.alias-category.telecommunications) .alias-service-icon { background: rgba(37, 99, 235, 0.2); }
.alias-card:has(.alias-category.travel) .alias-service-icon { background: rgba(6, 182, 212, 0.2); }
.alias-card:has(.alias-category.utilities) .alias-service-icon { background: rgba(100, 116, 139, 0.25); }
.alias-card:has(.alias-category.vpn) .alias-service-icon { background: rgba(139, 92, 246, 0.2); }
.alias-card:has(.alias-category.no-category) .alias-service-icon { background: rgba(107, 114, 128, 0.25); }

.alias-service-name {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: var(--line-height-snug);
}

.alias-service-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alias-category-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alias-sync-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alias-sync-badge svg {
    width: 14px;
    height: 14px;
}

.alias-sync-badge.synced {
    background: var(--sync-synced-bg);
    color: var(--sync-synced-text);
}

.alias-sync-badge.pending {
    background: var(--sync-pending-bg);
    color: var(--sync-pending-text);
}

.alias-sync-badge.conflict {
    background: var(--sync-conflict-bg);
    color: var(--sync-conflict-text);
}

.alias-category {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    text-transform: capitalize;
    transition: background 0.3s ease, color 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 18px;
}

.alias-category.bank { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.alias-category.betting { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.alias-category.cloud { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.alias-category.crypto { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.alias-category.delivery { background: rgba(180, 83, 9, 0.2); color: #d97706; }
.alias-category.finance { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.alias-category.gaming { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.alias-category.insurance { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }
.alias-category.media { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.alias-category.misc { background: rgba(168, 162, 158, 0.2); color: #d6d3d1; }
.alias-category.services { background: rgba(124, 92, 255, 0.2); color: #a99eff; }
.alias-category.shop { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.alias-category.social { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.alias-category.stream { background: rgba(217, 70, 239, 0.2); color: #e879f9; }
.alias-category.telecommunications { background: rgba(37, 99, 235, 0.2); color: #3b82f6; }
.alias-category.travel { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.alias-category.utilities { background: rgba(100, 116, 139, 0.25); color: #cbd5e1; }
.alias-category.vpn { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.alias-category.no-category { background: rgba(107, 114, 128, 0.25); color: #d1d5db; }

.alias-email {
    font-family: var(--font-family-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(124, 92, 255, 0.1);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.3s ease, color 0.3s ease;
    border: 1px solid rgba(124, 92, 255, 0.3);
}

.alias-email-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Prevent email text color change on hover */
.alias-card:hover .alias-email,
.alias-card:hover .alias-email-text {
    color: var(--color-primary) !important;
}

.alias-email-copy {
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.alias-email-copy:hover {
    background: rgba(124, 92, 255, 0.1);
}

.alias-email-copy svg {
    width: 18px;
    height: 18px;
}

.alias-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

.alias-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.alias-url {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alias-url:hover {
    color: var(--color-primary);
}

/* ===== ALIAS CARD THREE-DOTS MENU ===== */
.alias-menu-wrapper {
    position: relative;
}

.alias-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alias-menu-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.alias-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    overflow: hidden;
}

.alias-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.alias-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.alias-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.alias-menu-item.danger {
    color: var(--color-error);
}

.alias-menu-item.danger:hover {
    background: var(--color-error-light);
}

.alias-menu-item svg {
    flex-shrink: 0;
}

/* Legacy alias-actions - kept for compatibility but hidden by default */
.alias-actions {
    display: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 32px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px dashed var(--color-primary);
    transition: background 0.15s ease, border-color 0.15s ease;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state.hidden {
    display: none;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: var(--color-primary);
    transition: background 0.3s ease;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label span {
    font-weight: var(--font-weight-normal);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--input-bg);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-placeholder);
    opacity: 1;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--input-bg);
    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='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 44px;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.modal-footer {
    padding: 0 0 24px 0;
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-modal {
    flex: 1;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-modal-primary {
    background: var(--color-primary);
    color: white;
}

.btn-modal-primary:hover {
    background: var(--color-primary-hover);
}

.btn-modal-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-modal-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== RESULT SECTION ===== */
.result-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 24px;
    display: none;
    transition: background 0.3s ease;
}

.result-section.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

.result-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-email {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    transition: background 0.3s ease;
    border: 1px solid var(--border);
}

.result-email-text {
    flex: 1;
    font-family: 'Google Sans Code', 'Fira Code', monospace;
    font-size: 16px;
    color: var(--color-primary);
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.result-btn-copy {
    background: var(--color-primary);
    color: white;
    flex: 1;
}

.result-btn-copy:hover {
    background: var(--color-primary-hover);
}

.result-btn-close {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.result-btn-close:hover {
    background: var(--bg-hover);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--color-success);
    color: white;
}

.toast.info {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.toast svg {
    width: 20px;
    height: 20px;
}

/* ===== UNDO TOAST NOTIFICATION ===== */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
    z-index: 2000;
}

.undo-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.undo-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.undo-toast svg {
    width: 20px;
    height: 20px;
    color: var(--color-warning);
    flex-shrink: 0;
}

.undo-toast-actions {
    display: flex;
    align-items: center;
}

.undo-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.undo-btn:hover {
    background: var(--color-primary-hover);
}

#undoCountdown {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 36px;
    text-align: center;
}

/* ===== POPUP DIALOGS ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-dialog {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.popup-dialog-small {
    max-width: 400px;
}

.popup-overlay.active .popup-dialog {
    transform: scale(1) translateY(0);
}

.popup-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.popup-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.popup-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.popup-body {
    padding: 24px;
}

.popup-field {
    margin-bottom: 16px;
}

.popup-field:last-child {
    margin-bottom: 0;
}

.popup-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.popup-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: var(--transition);
}

.popup-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.popup-input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.popup-message {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.popup-alias-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.popup-alias-email {
    display: block;
    font-family: 'Google Sans Code', 'Fira Code', monospace;
    font-size: 15px;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-all;
}

/* Light mode - black text for email */
[data-theme="light"] .popup-alias-email {
    color: #000000;
}

.popup-alias-service {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.popup-warning {
    font-size: 13px;
    color: var(--color-error);
    text-align: center;
    margin: 0;
}

.popup-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
}

.btn-modal-danger {
    background: var(--color-error);
    color: white;
}

.btn-modal-danger:hover {
    background: var(--color-error-dark);
}

/* ===== PAGE CONTAINER ===== */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* ===== DASHBOARD CONTAINER ===== */
/* Width for 5 alias cards: 5 × 340px + 4 × 20px gap = 1780px */
.dashboard-container {
    max-width: 1780px;
    margin: 0 auto;
    width: 100%;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== FORM ELEMENTS ===== */
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn.primary {
    background: var(--color-primary);
    color: white;
}

.btn.primary:hover {
    background: var(--color-primary-hover);
}

.btn.primary:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--bg-hover);
}

.btn.danger {
    background: var(--color-error);
    color: white;
}

.btn.danger:hover {
    background: var(--color-error-dark);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* ===== SYNC CONTROLS ===== */
.sync-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sync-controls .btn {
    flex: 1;
    min-width: 120px;
}

.sync-status {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.sync-status.success {
    color: var(--color-success);
}

.sync-status.error {
    color: var(--color-error);
}

.sync-status.loading {
    color: var(--color-primary);
}

/* ===== ARCHIVE ACTIONS ===== */
.archive-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.archive-actions .btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
}

/* ===== TOKEN STATUS ===== */
.token-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.token-status.saved {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.token-status.not-saved {
    background: var(--color-error-light);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* ===== INFO TEXT ===== */
.info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== BACKUP SELECT DROPDOWN ===== */
.backup-select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--input-bg);
    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='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: var(--transition);
}

.backup-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.backup-select option {
    padding: 12px 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.backup-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== BACKUP STYLES ===== */
.backup-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.backup-actions .btn {
    flex: 1;
    min-width: 140px;
}

.backup-list {
    max-height: 400px;
    overflow-y: auto;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.backup-item-info {
    flex: 1;
}

.backup-timestamp {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.backup-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 8px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.backup-item-actions {
    display: flex;
    gap: 8px;
}

.backup-item-actions .btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* ===== DANGER ZONE ===== */
.danger-zone {
    border-color: var(--color-error);
    background: var(--color-error-light);
}

.danger-zone h3 {
    color: var(--color-error);
}

.warning-text {
    font-size: 0.8125rem;
    color: var(--color-warning);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--color-warning-light);
    border-radius: 6px;
    border: 1px solid var(--color-warning);
}

/* ===== HELP SECTION ===== */
.help-section {
    margin-bottom: 24px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.help-section p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.app-footer {
    display: none;
}

/* ===== EMPTY MESSAGE ===== */
.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* ===== HIDDEN ===== */
.hidden {
    display: none !important;
}

/* ===== SCROLLBAR ===== */
.backup-list::-webkit-scrollbar,
.archive-list::-webkit-scrollbar {
    width: 8px;
}

.backup-list::-webkit-scrollbar-track,
.archive-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.backup-list::-webkit-scrollbar-thumb,
.archive-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.backup-list::-webkit-scrollbar-thumb:hover,
.archive-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .aliases-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: flex;
        position: absolute;
        left: 32px;
    }

    .mobile-overlay {
        display: block;
    }

    .header-title {
        position: static;
    }

    .content {
        margin-left: 0;
        max-width: 100vw;
    }
}

@media (max-width: 900px) {
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .header-title {
        position: static;
    }

    .header-actions {
        position: static;
        width: auto;
        flex-wrap: wrap;
        margin-left: auto;
    }

    .filter-bar {
        flex-direction: column;
        gap: 12px;
    }

    .filter-search {
        width: 100%;
        min-width: 100%;
    }

    .filter-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .stat-item {
        flex-shrink: 0;
    }

    .aliases-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .aliases-skeleton-grid {
        grid-template-columns: 1fr;
    }
    
    .header-skeleton {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .stats-skeleton {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-skeleton .skeleton-stat {
        flex-shrink: 0;
    }
    
    .content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .btn-create,
    .btn-backup,
    .btn-secondary {
        padding: 0 12px;
        height: 36px;
        font-size: 13px;
    }
    
    .theme-toggle {
        height: 36px;
        padding: 3px;
    }
    
    .theme-btn {
        width: 28px;
        height: 28px;
    }
    
    .btn-create svg,
    .btn-backup svg,
    .btn-secondary svg {
        width: 14px;
        height: 14px;
    }
    
    /* Toast History Button - Tablet */
    .toast-history-btn {
        width: 36px;
        height: 36px;
    }
    
    .toast-history-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 12px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        height: auto;
    }
    
    .page-title {
        font-size: 20px;
        order: 1;
    }
    
    .header-title {
        position: static;
        order: 1;
        width: 100%;
    }
    
    .mobile-menu-btn {
        order: -1;
        position: relative;
        left: auto;
    }
    
    .header-actions {
        width: 100%;
        gap: 8px;
        order: 2;
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-left: 0;
    }
    
    .header-actions > * {
        flex-shrink: 0;
    }
    
    .btn-create {
        flex: 1;
        min-width: auto;
        justify-content: center;
        padding: 0 12px;
        height: 36px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .btn-create span {
        display: inline;
        white-space: nowrap;
    }
    
    .btn-create svg {
        width: 16px;
        height: 16px;
    }
    
    .btn-backup,
    .btn-secondary {
        padding: 0 10px;
        height: 36px;
        font-size: 12px;
    }
    
    .btn-backup span,
    .btn-secondary span {
        display: none;
    }
    
    .btn-backup svg,
    .btn-secondary svg {
        width: 18px;
        height: 18px;
    }
    
    .theme-toggle {
        padding: 3px;
        height: 36px;
        min-width: 36px;
    }
    
    .theme-btn {
        width: 28px;
        height: 28px;
    }
    
    .theme-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* Toast History Button - Mobile */
    .toast-history-btn {
        width: 34px;
        height: 34px;
    }
    
    .toast-history-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .filter-group label {
        display: none;
    }
    
    .filter-select {
        width: 100%;
        min-width: 100%;
    }
    
    .alias-card {
        padding: 16px;
    }
    
    .alias-service-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .alias-service-name {
        font-size: 15px;
    }
    
    .alias-email {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .alias-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    
    .alias-date {
        flex: 1;
    }
    
    .alias-url {
        flex: 0 0 auto;
        max-width: none;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-title {
        position: static;
        width: 100%;
    }

    .header-actions {
        width: 100%;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        margin-left: 0;
    }
    
    .header-actions > * {
        flex-shrink: 0;
    }
    
    .btn-create {
        padding: 0 10px;
        height: 34px;
        font-size: 12px;
        flex: 1;
    }
    
    .btn-create span {
        display: none;
    }
    
    .btn-backup,
    .btn-secondary {
        padding: 0 8px;
        height: 34px;
    }
    
    .btn-backup span,
    .btn-secondary span {
        display: none;
    }
    
    .btn-backup svg,
    .btn-secondary svg {
        width: 18px;
        height: 18px;
    }
    
    .theme-toggle {
        padding: 2px;
        height: 34px;
        min-width: 34px;
    }
    
    .theme-btn {
        width: 28px;
        height: 28px;
    }
    
    .theme-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* Toast History Button - Small Mobile */
    .toast-history-btn {
        width: 32px;
        height: 32px;
    }
    
    .toast-history-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }

    .btn-modal {
        width: 100%;
    }

    .popup-dialog {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .popup-body {
        padding: 16px;
    }

    .popup-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }

    .sync-controls {
        flex-direction: column;
    }

    .sync-controls .btn {
        width: 100%;
        min-width: 100%;
    }

    .backup-actions {
        flex-direction: column;
    }

    .backup-actions .btn {
        width: 100%;
    }

    .archive-actions {
        flex-direction: column;
    }

    .archive-actions .btn {
        width: 100%;
    }

    .backup-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .backup-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
}

.skeleton-badge {
    width: 80px;
    height: 20px;
    border-radius: 20px;
}

.skeleton-email {
    height: 44px;
    width: 100%;
    border-radius: var(--radius-sm);
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-height: 180px;
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.skeleton-service {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-stat {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 70px;
    text-align: center;
}

.skeleton-stat-value {
    width: 30px;
    height: 20px;
    margin: 0 auto 4px;
}

.skeleton-stat-label {
    width: 50px;
    height: 12px;
    margin: 0 auto;
}

/* Aliases grid skeleton */
.aliases-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* Stats bar skeleton */
.stats-skeleton {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stats-skeleton .skeleton-stat {
    flex-shrink: 0;
}

/* Header skeleton */
.header-skeleton {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.header-skeleton .skeleton-text {
    width: 200px;
    height: 28px;
}

/* Backup list skeleton */
.backup-list-skeleton {
    max-height: 400px;
    overflow-y: auto;
}

.backup-item-skeleton {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.backup-item-skeleton .skeleton-text {
    margin-bottom: 0;
    width: 150px;
}

.backup-item-skeleton .skeleton-text.short {
    width: 80px;
}

.backup-actions-skeleton {
    display: flex;
    gap: 8px;
}

.backup-actions-skeleton .skeleton {
    width: 80px;
    height: 32px;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== PAGE TRANSITIONS ===== */
/* Simple fade transitions for pages */

/* Fade transition */
.fade-in {
    animation: fadeIn 0.15s ease forwards;
}

.fade-out {
    animation: fadeOut 0.15s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Scale transition for cards */
.alias-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.15s ease forwards;
    opacity: 0;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alias-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* Staggered animation for cards */
.alias-card:nth-child(1) { animation-delay: 0.05s; }
.alias-card:nth-child(2) { animation-delay: 0.1s; }
.alias-card:nth-child(3) { animation-delay: 0.15s; }
.alias-card:nth-child(4) { animation-delay: 0.2s; }
.alias-card:nth-child(5) { animation-delay: 0.25s; }
.alias-card:nth-child(6) { animation-delay: 0.3s; }
.alias-card:nth-child(7) { animation-delay: 0.35s; }
.alias-card:nth-child(8) { animation-delay: 0.4s; }
.alias-card:nth-child(9) { animation-delay: 0.45s; }
.alias-card:nth-child(10) { animation-delay: 0.5s; }

/* Smooth button transitions */
.btn-create:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-create:active {
    transform: translateY(0);
}

/* Sidebar nav link transition */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.sidebar-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar-nav-link.active {
    background: var(--color-primary);
    color: white;
}

/* Menu dropdown animation */
.alias-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.alias-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px) scale(1);
}

.alias-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.alias-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.alias-menu-item.danger:hover {
    background: var(--color-error-light);
}


  
/* ===== TRASH PAGE STYLES ===== */
.trash-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.trash-info .info-text {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.trash-info .info-text svg {
    flex-shrink: 0;
    color: var(--color-warning);
}

.trash-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trash-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 20px;
}

/* Trash Grid */
.trash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Trash Card */
.trash-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.15s ease forwards;
    opacity: 0;
}

.trash-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--color-warning);
}

.trash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.trash-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-bottom: 16px;
}

.trash-deleted-date {
    font-size: 13px;
    color: var(--color-warning);
    font-weight: 500;
}

.trash-original-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Trash Actions */
.trash-actions {
    display: flex;
    gap: 8px;
}

.btn-restore {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--color-success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-restore:hover {
    background: var(--color-success-dark);
    transform: translateY(-1px);
}

.btn-permanent-delete {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    color: var(--color-error);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-permanent-delete:hover {
    background: var(--color-error-light);
}

/* Category-specific icon backgrounds for trash cards - matching alias-card colors */
.trash-card:has(.alias-category.bank) .alias-service-icon { background: rgba(239, 68, 68, 0.2); }
.trash-card:has(.alias-category.betting) .alias-service-icon { background: rgba(249, 115, 22, 0.2); }
.trash-card:has(.alias-category.cloud) .alias-service-icon { background: rgba(14, 165, 233, 0.2); }
.trash-card:has(.alias-category.crypto) .alias-service-icon { background: rgba(245, 158, 11, 0.2); }
.trash-card:has(.alias-category.delivery) .alias-service-icon { background: rgba(180, 83, 9, 0.2); }
.trash-card:has(.alias-category.finance) .alias-service-icon { background: rgba(34, 197, 94, 0.2); }
.trash-card:has(.alias-category.gaming) .alias-service-icon { background: rgba(168, 85, 247, 0.2); }
.trash-card:has(.alias-category.insurance) .alias-service-icon { background: rgba(20, 184, 166, 0.2); }
.trash-card:has(.alias-category.media) .alias-service-icon { background: rgba(236, 72, 153, 0.2); }
.trash-card:has(.alias-category.misc) .alias-service-icon { background: rgba(168, 162, 158, 0.25); }
.trash-card:has(.alias-category.services) .alias-service-icon { background: rgba(124, 92, 255, 0.2); }
.trash-card:has(.alias-category.shop) .alias-service-icon { background: rgba(16, 185, 129, 0.2); }
.trash-card:has(.alias-category.social) .alias-service-icon { background: rgba(59, 130, 246, 0.2); }
.trash-card:has(.alias-category.stream) .alias-service-icon { background: rgba(217, 70, 239, 0.2); }
.trash-card:has(.alias-category.telecommunications) .alias-service-icon { background: rgba(37, 99, 235, 0.2); }
.trash-card:has(.alias-category.travel) .alias-service-icon { background: rgba(6, 182, 212, 0.2); }
.trash-card:has(.alias-category.utilities) .alias-service-icon { background: rgba(100, 116, 139, 0.25); }
.trash-card:has(.alias-category.vpn) .alias-service-icon { background: rgba(139, 92, 246, 0.2); }
.trash-card:has(.alias-category.no-category) .alias-service-icon { background: rgba(107, 114, 128, 0.25); }

/* Empty Trash Button in Header */
.header-actions .btn-danger {
    background: var(--color-error);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    height: 40px;
}

.header-actions .btn-danger:hover:not(:disabled) {
    background: var(--color-error-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.header-actions .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-actions .btn-danger svg {
    width: 16px;
    height: 16px;
}

/* Alias card with conflict */
.alias-card.conflict {
    border-color: var(--color-warning);
    background: var(--color-warning-light);
}

.alias-card.conflict:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Conflict indicator badge */
.conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-warning);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Conflict indicator in header */
.sync-status.conflict {
    color: var(--color-warning);
    background: var(--color-warning-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-warning);
}

/* ===== CONFLICT RESOLUTION MODAL ===== */
.conflict-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.conflict-modal-overlay.active .conflict-modal {
    transform: scale(1) translateY(0);
}

.conflict-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.conflict-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.conflict-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.conflict-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.conflict-modal-title svg {
    color: var(--color-warning);
    flex-shrink: 0;
}

.conflict-modal-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.conflict-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.conflict-modal-body {
    padding: 24px;
}

/* Conflict comparison view */
.conflict-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.conflict-version {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.conflict-version-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.conflict-version-header svg {
    width: 20px;
    height: 20px;
}

.conflict-version-header.local {
    color: var(--color-primary);
}

.conflict-version-header.cloud {
    color: var(--color-success);
}

.conflict-version-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conflict-field {
    margin-bottom: 12px;
}

.conflict-field:last-child {
    margin-bottom: 0;
}

.conflict-field-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.conflict-field-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.conflict-field-value.changed {
    background: var(--color-warning-light);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid var(--color-warning);
}

.conflict-field-value.same {
    color: var(--text-muted);
}

/* Differences summary */
.conflict-differences {
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.conflict-differences-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-warning);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.conflict-differences-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.conflict-differences-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conflict-differences-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-warning);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Conflict resolution actions */
.conflict-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.conflict-btn {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.conflict-btn svg {
    width: 24px;
    height: 24px;
}

.conflict-btn-keep-local {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.conflict-btn-keep-local:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.conflict-btn-keep-cloud {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.conflict-btn-keep-cloud:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.conflict-btn-merge {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.conflict-btn-merge:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.conflict-btn-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

/* Conflict count indicator in header */
.conflict-count-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-warning-light);
    color: var(--color-warning);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.conflict-count-badge:hover {
    background: rgba(245, 158, 11, 0.25);
}

.conflict-count-badge svg {
    width: 16px;
    height: 16px;
}

/* Conflict queue item in list */
.conflict-queue-item {
    cursor: pointer;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.conflict-queue-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-warning);
}

.conflict-queue-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.conflict-queue-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive conflict modal */
@media (max-width: 600px) {
    .conflict-modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .conflict-comparison {
        grid-template-columns: 1fr;
    }
    
    .conflict-actions {
        grid-template-columns: 1fr;
    }
}

/* Staggered animation for trash cards */
.trash-card:nth-child(1) { animation-delay: 0.05s; }
.trash-card:nth-child(2) { animation-delay: 0.1s; }
.trash-card:nth-child(3) { animation-delay: 0.15s; }
.trash-card:nth-child(4) { animation-delay: 0.2s; }
.trash-card:nth-child(5) { animation-delay: 0.25s; }
.trash-card:nth-child(6) { animation-delay: 0.3s; }
.trash-card:nth-child(7) { animation-delay: 0.35s; }
.trash-card:nth-child(8) { animation-delay: 0.4s; }
.trash-card:nth-child(9) { animation-delay: 0.45s; }
.trash-card:nth-child(10) { animation-delay: 0.5s; }

/* Responsive trash grid */
@media (max-width: 900px) {
    .trash-grid {
        grid-template-columns: 1fr;
    }
    
    .trash-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .trash-card {
        padding: 16px;
    }
    
    .trash-actions {
        flex-direction: column;
    }
    
    .btn-restore,
    .btn-permanent-delete {
        width: 100%;
    }
}

.lucide-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Icon sizing variants */
.lucide-icon.sm {
    width: 16px;
    height: 16px;
}

.lucide-icon.lg {
    width: 24px;
    height: 24px;
}

/* Sidebar navigation icons */
.sidebar-nav-link .lucide-icon {
    width: 20px;
    height: 20px;
}

/* Header action button icons */
.btn-create .lucide-icon,
.btn-backup .lucide-icon,
.btn-secondary .lucide-icon {
    width: 16px;
    height: 16px;
}

/* Theme toggle icons */
.theme-btn .lucide-icon {
    width: 16px;
    height: 16px;
}

/* Mobile menu button icons */
.mobile-menu-btn .lucide-icon {
    width: 20px;
    height: 20px;
}

/* Modal close button icons */
.modal-close .lucide-icon,
.popup-close .lucide-icon,
.conflict-modal-close .lucide-icon {
    width: 20px;
    height: 20px;
}

/* Toast icons */
.toast .lucide-icon {
    width: 20px;
    height: 20px;
}

/* Undo toast icons */
.undo-toast .lucide-icon {
    width: 20px;
    height: 20px;
    color: var(--color-warning);
    flex-shrink: 0;
}

/* Conflict modal icons */
.conflict-modal-title .lucide-icon {
    width: 24px;
    height: 24px;
    color: var(--color-warning);
    flex-shrink: 0;
}

.conflict-differences-title .lucide-icon {
    width: 16px;
    height: 16px;
    color: var(--color-warning);
}

.conflict-btn .lucide-icon {
    width: 24px;
    height: 24px;
}

/* Result button icons */
.result-btn-copy .lucide-icon {
    width: 18px;
    height: 18px;
}

/* Trash info icon */
.trash-info .info-text .lucide-icon {
    flex-shrink: 0;
    color: var(--color-warning);
}

/* ===== IMPROVED CARD DESIGN ===== */

/* Remove category color accent bar from left side of card */
/* Note: alias-card-accent styling removed - no colored left border */

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .page,
    .alias-card,
    .trash-card,
    .empty-state,
    .result-section,
    .toast,
    .undo-toast,
    .modal,
    .popup-dialog,
    .conflict-modal,
    .alias-menu-dropdown,
    .fade-in,
    .fade-out {
        animation: none !important;
    }

    .page.active {
        opacity: 1;
        transform: none;
    }

    .alias-card,
    .trash-card {
        opacity: 1;
        transform: none;
    }

    .toast,
    .undo-toast {
        transform: none;
        opacity: 1;
    }

    .modal,
    .popup-dialog,
    .conflict-modal {
        transform: none;
    }

    .alias-menu-dropdown {
        transform: none;
        opacity: 1;
        visibility: visible;
    }
}

/* ===== ENHANCED TOAST NOTIFICATION SYSTEM ===== */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: none;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast-container.active {
    display: flex;
}

/* Enhanced Toast Styles */
.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.dismissing {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Types */
.toast-success {
    background: var(--color-success);
    border-color: var(--color-success-dark);
    color: white;
}

.toast-success .toast-icon {
    color: white;
}

.toast-error {
    background: var(--color-error);
    border-color: var(--color-error-dark);
    color: white;
}

.toast-error .toast-icon {
    color: white;
}

.toast-warning {
    background: var(--color-warning);
    border-color: var(--color-warning-dark);
    color: white;
}

.toast-warning .toast-icon {
    color: white;
}

.toast-info {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.toast-info .toast-icon {
    color: white;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-alias {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Toast Action Button */
.toast-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    align-self: flex-start;
}

.toast-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toast-info .toast-action-btn {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.toast-info .toast-action-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Toast Close Button */
.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* Toast History Button */
.toast-history-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.toast-history-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--color-primary);
}

.toast-history-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-error);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Toast History Panel */
.toast-history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    z-index: 2100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.toast-history-panel.active {
    right: 0;
}

.toast-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.toast-history-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.toast-history-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.toast-history-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toast-history-close svg {
    width: 18px;
    height: 18px;
}

/* Toast History List */
.toast-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.toast-history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

/* Toast History Items */
.toast-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.toast-history-item:hover {
    background: var(--bg-tertiary);
}

.toast-history-item.dismissed {
    opacity: 0.6;
}

.toast-history-item.seen {
    opacity: 0.5;
    background: var(--bg-tertiary);
}

.toast-history-item-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-history-item-icon svg {
    width: 100%;
    height: 100%;
}

.toast-history-item-content {
    flex: 1;
    min-width: 0;
}

.toast-history-item-alias {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding: 2px 6px;
    background: var(--color-primary-light);
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.toast-history-item-message {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

.toast-history-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.toast-history-item-action {
    font-size: 11px;
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Toast History Footer */
.toast-history-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.toast-history-clear {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.toast-history-clear:hover {
    background: var(--color-error-light);
    border-color: var(--color-error);
    color: var(--color-error);
}

/* Toast History Panel Overlay */
.toast-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.toast-history-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Notification button - disabled and hidden */
#toastHistoryBtn {
    display: none !important;
}

/* Toast History Panel - also hide since button is hidden */
.toast-history-panel {
    display: none !important;
}

/* Responsive Toast */
@media (max-width: 480px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .toast-history-panel {
        width: 100%;
        right: -100%;
    }

    .toast-history-panel.active {
        right: 0;
    }
}

/* ===== EMAIL DETAIL MODAL ===== */
.email-detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 16px;
}

.email-detail-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.email-detail-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    animation: emailDetailModalIn 0.2s ease forwards;
}

@keyframes emailDetailModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.email-detail-modal-overlay.active .email-detail-modal {
    transform: scale(1) translateY(0);
}

.email-detail-modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.email-detail-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.email-detail-service-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.email-detail-modal-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.email-detail-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.email-detail-modal-body {
    padding: 20px;
}

.email-detail-section {
    margin-bottom: 16px;
}

.email-detail-section:last-child {
    margin-bottom: 0;
}

.email-detail-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.email-detail-email-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.email-detail-email {
    flex: 1;
    font-family: var(--font-family-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    word-break: break-all;
}

.email-detail-copy-btn {
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-detail-copy-btn:hover {
    background: rgba(124, 92, 255, 0.15);
}

.email-detail-copy-btn svg {
    width: 18px;
    height: 18px;
}

.email-detail-category {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.email-detail-date {
    font-size: 14px;
    color: var(--text-primary);
}

.email-detail-url {
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
    word-break: break-all;
    display: block;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.email-detail-url:hover {
    text-decoration: underline;
}

.email-detail-modal-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 12px;
}

/* Category-specific colors for email detail modal icon */
.email-detail-modal:has(.bank) .email-detail-service-icon { background: rgba(239, 68, 68, 0.2); }
.email-detail-modal:has(.betting) .email-detail-service-icon { background: rgba(249, 115, 22, 0.2); }
.email-detail-modal:has(.cloud) .email-detail-service-icon { background: rgba(14, 165, 233, 0.2); }
.email-detail-modal:has(.crypto) .email-detail-service-icon { background: rgba(245, 158, 11, 0.2); }
.email-detail-modal:has(.delivery) .email-detail-service-icon { background: rgba(180, 83, 9, 0.2); }
.email-detail-modal:has(.finance) .email-detail-service-icon { background: rgba(34, 197, 94, 0.2); }
.email-detail-modal:has(.gaming) .email-detail-service-icon { background: rgba(168, 85, 247, 0.2); }
.email-detail-modal:has(.insurance) .email-detail-service-icon { background: rgba(20, 184, 166, 0.2); }
.email-detail-modal:has(.media) .email-detail-service-icon { background: rgba(236, 72, 153, 0.2); }
.email-detail-modal:has(.misc) .email-detail-service-icon { background: rgba(168, 162, 158, 0.25); }
.email-detail-modal:has(.services) .email-detail-service-icon { background: rgba(124, 92, 255, 0.2); }
.email-detail-modal:has(.shop) .email-detail-service-icon { background: rgba(16, 185, 129, 0.2); }
.email-detail-modal:has(.social) .email-detail-service-icon { background: rgba(59, 130, 246, 0.2); }
.email-detail-modal:has(.stream) .email-detail-service-icon { background: rgba(217, 70, 239, 0.2); }
.email-detail-modal:has(.telecommunications) .email-detail-service-icon { background: rgba(37, 99, 235, 0.2); }
.email-detail-modal:has(.travel) .email-detail-service-icon { background: rgba(6, 182, 212, 0.2); }
.email-detail-modal:has(.utilities) .email-detail-service-icon { background: rgba(100, 116, 139, 0.25); }
.email-detail-modal:has(.vpn) .email-detail-service-icon { background: rgba(139, 92, 246, 0.2); }
.email-detail-modal:has(.no-category) .email-detail-service-icon { background: rgba(107, 114, 128, 0.25); }

/* Mobile responsive styles for email detail modal */
@media (max-width: 480px) {
    .email-detail-modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }
    
    .email-detail-modal {
        max-height: 80vh;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-bottom: 0;
        animation: slideUpEmailDetail 0.3s ease forwards;
    }
    
    @keyframes slideUpEmailDetail {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .email-detail-modal-header {
        padding: 16px 16px 0;
    }
    
    .email-detail-modal-title {
        font-size: 16px;
    }
    
    .email-detail-service-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .email-detail-modal-body {
        padding: 16px;
    }
    
    .email-detail-section {
        margin-bottom: 12px;
    }
    
    .email-detail-email-container {
        padding: 10px 12px;
    }
    
    .email-detail-email {
        font-size: 14px;
    }
    
    .email-detail-modal-footer {
        padding: 0 16px 16px;
        flex-direction: column;
        gap: 10px;
    }
    
    .email-detail-modal-footer .btn-modal {
        width: 100%;
        padding: 12px 16px;
    }
}

@media (max-width: 360px) {
    .email-detail-modal-overlay {
        padding: 8px;
    }
    
    .email-detail-modal-header {
        padding: 12px 12px 0;
    }
    
    .email-detail-modal-body {
        padding: 12px;
    }
    
    .email-detail-modal-footer {
        padding: 0 12px 12px;
    }
    
    .email-detail-label {
        font-size: 11px;
    }
    
    .email-detail-email {
        font-size: 13px;
    }
}

/* Clickable service name in alias card */
.alias-service-name {
    cursor: default;
    transition: color 0.15s ease;
}

/* ===== EMAIL PREVIEW TOOLTIP ===== */
.email-preview-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.email-preview-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.email-preview-tooltip {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    max-width: 90vw;
}

.email-preview-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.email-preview-text {
    font-family: var(--font-family-mono);
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    word-break: break-all;
    white-space: nowrap;
}

/* Light mode - black text for email preview */
[data-theme="light"] .email-preview-text {
    color: #000000;
}

/* Responsive email preview tooltip */
@media (max-width: 480px) {
    .email-preview-tooltip {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        padding: 24px 20px;
        width: 95vw !important;
        max-width: 500px;
    }
    
    .email-preview-text {
        font-size: 30px;
        white-space: nowrap;
        text-align: center;
        line-height: 1.3;
        display: inline-block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

/* ===== EMAIL PREVIEW BRIGHTNESS EFFECT ===== */
/* When email preview is active, remove brightness effect for cleaner mobile view */
body.email-preview-active,
body.email-preview-active .app-container,
body.email-preview-active .content,
body.email-preview-active main {
    filter: none;
}

/* Also keep sidebar normal brightness */
body.email-preview-active .sidebar {
    filter: none;
}
