 :root {
            /* Light Theme - Gradient Glass */
            --primary: #3b82f6;
            --primary-hover: #2563eb;
            --primary-light: rgba(59, 130, 246, 0.1);
            --background: #d6e8f5;
            --card-bg: rgba(255, 255, 255, 0.55);
            --sidebar-bg: #d6e8f5;
            --text-primary: #1a2340;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-color: rgba(255, 255, 255, 0.5);
            --hover-bg: rgba(255, 255, 255, 0.4);
            --shadow-color: rgba(100, 130, 200, 0.08);
            --shadow-hover: rgba(100, 130, 200, 0.15);

            /* Glass Variables */
            --glass-bg: rgba(255, 255, 255, 0.5);
            --glass-border: rgba(255, 255, 255, 0.7);
            --glass-shadow: 0 8px 32px rgba(100, 130, 200, 0.12);

            /* Button Colors */
            --primary-btn-bg: rgba(59, 130, 246, 0.1);
            --primary-btn-color: #3b82f6;
            --secondary-btn-bg: rgba(255, 255, 255, 0.6);
            --secondary-btn-color: #475569;
            --success-btn-bg: rgba(34, 197, 94, 0.12);
            --success-btn-color: #22c55e;
            --info-btn-bg: rgba(139, 92, 246, 0.1);
            --info-btn-color: #8b5cf6;
            --warning-btn-bg: #f59e0b;
            --warning-btn-color: #ffffff;
            --danger-btn-bg: rgba(239, 68, 68, 0.1);
            --danger-btn-color: #ef4444;
            --dark-btn-bg: #1a2340;
            --dark-btn-color: #ffffff;

            /* Card Colors */
            --tools-color: #6366f1;
            --tools-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.01) 100%);
            --expiry-color: #10b981;
            --expiry-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.01) 100%);
            --subscription-color: #f59e0b;
            --subscription-gradient: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.01) 100%);
        }

        [data-theme="dark"] {
            /* Dark Theme - Deep Gradient */
            --primary: #FFB400;
            --primary-hover: #FFCA4D;
            --primary-light: rgba(255, 180, 0, 0.15);
            --background: #0f172a;
            --card-bg: rgba(20, 25, 55, 0.7);
            --sidebar-bg: #0f172a;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --border-color: rgba(255, 255, 255, 0.06);
            --hover-bg: rgba(255, 255, 255, 0.06);
            --shadow-color: rgba(0, 0, 0, 0.4);
            --shadow-hover: rgba(0, 0, 0, 0.6);

            /* Glass Variables */
            --glass-bg: rgba(255, 255, 255, 0.04);
            --glass-border: rgba(255, 255, 255, 0.06);
            --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
        }

        body {
            background: var(--background);
            color: var(--text-primary);
            transition: background 0.3s ease, color 0.3s ease;
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                radial-gradient(ellipse 60% 50% at 15% 20%, rgba(180,210,255,0.85) 0%, transparent 60%),
                radial-gradient(ellipse 50% 60% at 85% 10%, rgba(200,185,255,0.75) 0%, transparent 55%),
                radial-gradient(ellipse 40% 50% at 70% 80%, rgba(170,220,255,0.6) 0%, transparent 55%),
                radial-gradient(ellipse 60% 40% at 30% 90%, rgba(195,225,255,0.5) 0%, transparent 60%),
                linear-gradient(135deg, #c8dcf0 0%, #d4d0f0 40%, #c5dff5 70%, #b8d5ee 100%);
            z-index: -1;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        [data-theme="dark"] body::before {
            background:
                radial-gradient(ellipse 60% 50% at 15% 20%, rgba(30,40,100,0.6) 0%, transparent 60%),
                radial-gradient(ellipse 50% 60% at 85% 10%, rgba(60,20,100,0.5) 0%, transparent 55%),
                radial-gradient(ellipse 40% 50% at 70% 80%, rgba(20,50,120,0.4) 0%, transparent 55%),
                radial-gradient(ellipse 60% 40% at 30% 90%, rgba(50,20,80,0.3) 0%, transparent 60%),
                linear-gradient(135deg, #0a0a1e 0%, #101030 40%, #0d1528 70%, #080e1e 100%);
        }

        .container {
            max-width: 1440px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        /* Layout Structure */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        /* Sidebar - Hidden by default */
        .sidebar {
            width: 70px;
            background: transparent;
            box-shadow: none;
            border-right: none;
            z-index: 100;
            transition: width 0.3s ease;
            overflow: visible;
            position: fixed;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .sidebar.expanded {
            width: 280px;
        }

        .sidebar-brand {
            padding: 1.25rem 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: none;
            overflow: hidden;
        }

        .sidebar-brand h1 {
            display: none;
            font-size: 1.5rem;
            color: #000;
            font-weight: 700;
            margin-left: 1rem;
            white-space: nowrap;
        }

        .sidebar.expanded .sidebar-brand h1 {
            display: block;
        }

        .sidebar-brand img {
            height: 40px;
            width: 40px;
            object-fit: contain;
        }
[data-theme="dark"] .sidebar-brand h1 {
    color: #ffffff;
}


[data-theme="dark"] .sidebar-toggle-container,
[data-theme="dark"] .mobile-menu-actions {
    background: transparent;
}
        .sidebar-nav {
            padding: 1rem 0;
            flex: 1;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--primary) transparent;
            min-height: 0; /* Ensures flex item can shrink */
            max-height: calc(100vh - 200px); /* Reserve space for brand, toggle, and profile */
        }
        
        /* Custom scrollbar styling */
        .sidebar-nav::-webkit-scrollbar {
            width: 6px;
        }
        
        .sidebar-nav::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .sidebar-nav::-webkit-scrollbar-thumb {
            background-color: rgba(255, 180, 0, 0.3);
            border-radius: 8px;
            border: 2px solid transparent;
        }
        
        .sidebar-nav::-webkit-scrollbar-thumb:hover {
            background-color: var(--primary);
        }

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

        /* Main Navigation Items */
        .nav-item {
            margin: 0.2rem 0.5rem;
        }

        .nav-link {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.75rem 0.5rem;
            color: var(--text-secondary);
            text-decoration: none;
            transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
            border-radius: 0.5rem;
            font-weight: 500;
            cursor: pointer;
            position: relative;
        }

        .sidebar.expanded .nav-link {
            justify-content: space-between;
            padding: 0.75rem 1.5rem;
        }

        .nav-link:hover,
        .nav-link.active {
            color: var(--primary);
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            transform: translateX(3px);
            border-radius: 12px;
        }

        .nav-link-content {
            display: flex;
            align-items: center;
        }

        .nav-link-content > i {
            font-size: 1.15rem;
            width: 2.2rem;
            height: 2.2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            position: relative;
            flex-shrink: 0;
        }

        .nav-link-content > i::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 10px;
            background: #ffffff;
            opacity: 1;
            z-index: -1;
        }

        [data-theme="dark"] .nav-link-content > i::after {
            background: rgba(255, 255, 255, 0.1);
        }

        .nav-link i.dropdown-arrow {
            width: auto;
            height: auto;
            font-size: 0.7rem;
        }

        .nav-link i.dropdown-arrow::after {
            display: none;
        }

        .sidebar.expanded .nav-link-content > i {
            margin-right: 0.75rem;
        }

        .nav-link span {
            display: none;
            white-space: nowrap;
        }

        .sidebar.expanded .nav-link span {
            display: block;
        }

        /* Dropdown Arrow */
        .dropdown-arrow {
            display: none !important;
            font-size: 0.5rem;
            color: var(--text-muted);
            transition: transform 0.3s ease, opacity 0.3s ease;
            opacity: 0.15;
            font-weight: 100;
        }

        .sidebar.expanded .dropdown-arrow {
            display: block !important;
        }

        .nav-item.expanded .dropdown-arrow {
            transform: rotate(90deg);
            opacity: 0.25;
        }

        .nav-link:hover .dropdown-arrow {
            opacity: 0.35;
        }

        /* Ensure dropdowns are completely hidden when sidebar is collapsed */
        .sidebar:not(.expanded) .dropdown-arrow {
            display: none !important;
            visibility: hidden;
        }

        /* Dropdown Menu */
        .nav-dropdown {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            background: var(--glass-bg);
            margin: 0.2rem 0;
            border-radius: 12px;
        }

        .nav-item.expanded .nav-dropdown {
            max-height: 500px;
        }

        .dropdown-item {
            display: block;
            padding: 0.6rem 1.5rem 0.6rem 3rem;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.9rem;
            transition: color 0.2s ease, background-color 0.2s ease, padding-left 0.2s ease;
            position: relative;
        }

        .dropdown-item::before {
            content: '•';
            position: absolute;
            left: 2.2rem;
            color: var(--text-muted);
        }

        .dropdown-item:hover {
            color: var(--primary);
            background-color: var(--primary-light);
            padding-left: 3.2rem;
        }

        .dropdown-item:hover::before {
            color: var(--primary);
        }

        /* Hide dropdowns when sidebar is collapsed */
        .sidebar:not(.expanded) .nav-dropdown {
            display: none;
        }

        /* Moved sidebar toggle above user profile */
        .sidebar-toggle-container {
            position: absolute;
            top: 24px;
            right: -18px;
            padding: 0;
            display: flex;
            justify-content: center;
            border-top: none;
            flex-shrink: 0;
            background: transparent;
            z-index: 101;
        }

        .sidebar.expanded .sidebar-toggle-container {
            right: -18px;
        }

        /* NEW: Mobile Menu Actions */
        .mobile-menu-actions {
            display: none;
            border-top: none;
            padding: 1rem 0;
            flex-shrink: 0; /* Prevent shrinking */
            background: transparent;
        }

        .mobile-menu-actions ul {
            list-style: none;
        }

        .mobile-menu-actions ul li a {
            display: flex;
            align-items: center;
            padding: 0.75rem 1.5rem;
            color: var(--text-secondary);
            text-decoration: none;
            transition: color 0.2s ease, background-color 0.2s ease;
            border-radius: 0.5rem;
            margin: 0.2rem 0.5rem;
            font-weight: 500;
        }

        .mobile-menu-actions ul li a:hover {
            color: var(--primary);
            background-color: var(--primary-light);
        }

        .mobile-menu-actions ul li a i {
            font-size: 1.25rem;
            width: 1.5rem;
            text-align: center;
            margin-right: 0.75rem;
        }

        .mobile-menu-actions ul li a.theme-toggle i {
            color: #10b981;
        }

        .mobile-menu-actions ul li a.notification i {
            color: #6366f1;
        }

        .mobile-menu-actions ul li a.upgrade {
            color: white;
            background-color: var(--primary);
            margin: 0.5rem 1rem;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-weight: 600;
            box-shadow: 0 4px 8px rgba(255, 180, 0, 0.3);
        }

        .mobile-menu-actions ul li a.upgrade i {
            color: white;
        }

        .mobile-menu-close {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            background-color: var(--primary);
            color: white;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(255, 180, 0, 0.4);
            z-index: 1001;
        }

        .user-profile {
            padding: 0.75rem;
            border-top: none;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            position: relative;
            z-index: 10;
            margin: auto 0.5rem 0.5rem 0.5rem;
            background: var(--glass-bg);
            border-radius: 16px;
            border: 1px solid var(--glass-border);
        }

        .sidebar.expanded .user-profile {
            padding: 0.75rem 1rem;
            justify-content: flex-start;
        }

        /* Sidebar Logout Button */
        .sidebar-logout-btn {
            display: none;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            color: var(--text-muted);
            text-decoration: none;
            transition: background-color 0.2s ease, color 0.2s ease;
            flex-shrink: 0;
            margin-left: auto;
        }

        .sidebar.expanded .sidebar-logout-btn {
            display: flex;
        }

        .sidebar-logout-btn i {
            font-size: 1rem;
            transition: color 0.2s ease;
        }

        .sidebar-logout-btn:hover {
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            text-decoration: none;
        }

        .sidebar-logout-btn:hover i {
            color: #ef4444;
        }

        [data-theme="dark"] .sidebar-logout-btn:hover {
            background: rgba(239, 68, 68, 0.15);
            color: #fca5a5;
        }

        [data-theme="dark"] .sidebar-logout-btn:hover i {
            color: #fca5a5;
        }

        .profile-brief {
            display: flex;
            align-items: center;
        }

        .profile-brief img {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
        }

        /* Sidebar Avatar with Golden Ring for Active Plan */
        .sidebar-avatar-wrap {
            position: relative;
            flex-shrink: 0;
        }

        .sidebar-avatar-wrap img {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            object-fit: cover;
        }

        .sidebar-avatar-wrap.has-active-plan img {
            border: 2.5px solid #f59e0b;
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
        }

        .profile-info {
            display: none;
            min-width: 0; /* Prevent text overflow issues */
        }

        .sidebar.expanded .profile-info {
            display: block;
            margin-left: 0.75rem;
        }

        .profile-info h6 {
            font-size: 0.9rem;
            margin-bottom: 0.2rem;
            color: #1a2340 !important;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        [data-theme="dark"] .profile-info h6 {
            color: #f1f5f9 !important;
        }

        .profile-info span {
            font-size: 0.8rem;
            color: #64748b !important;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        [data-theme="dark"] .profile-info span {
            color: #94a3b8 !important;
        }

        /* Main Content - Frosted Glass Island */
        .main-content {
            flex: 1;
            margin-left: 80px;
            margin-right: 10px;
            margin-top: 10px;
            margin-bottom: 10px;
            padding: 1.5rem 2rem;
            transition: margin-left 0.3s ease;
            overflow-y: auto;
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 24px;
            border: 1px solid var(--glass-border);
            box-shadow: var(--glass-shadow);
            scrollbar-width: thin;
            scrollbar-color: var(--primary-light) transparent;
        }
        
        /* Main content scrollbar */
        .main-content::-webkit-scrollbar {
            width: 8px;
        }
        
        .main-content::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .main-content::-webkit-scrollbar-thumb {
            background-color: rgba(255, 180, 0, 0.2);
            border-radius: 8px;
            border: 2px solid var(--card-bg);
        }

        .main-content::-webkit-scrollbar-thumb:hover {
            background-color: rgba(255, 180, 0, 0.5);
        }

        .sidebar.expanded ~ .main-content {
            margin-left: 290px;
        }

        /* Topbar */
        .topbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
            background-color: transparent;
            padding: 0.5rem 0;
            border-radius: 0;
            box-shadow: none;
        }

        .welcome-title h1 {
            font-size: 1.75rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .welcome-title p {
            color: var(--text-secondary);
            font-size: 0.95rem;
            margin-top: 0.25rem;
        }

        .search-container {
            flex: 1;
            max-width: 400px;
            margin: 0 1rem;
        }

        .search-container input,
        .search-container .search-input {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            color: var(--text-primary);
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .topbar-actions {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        /* Topbar Action Icons — Pill Style (matches user trigger) */
        .action-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 38px;
            width: 38px;
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            background: var(--glass-bg);
            cursor: pointer;
            transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
            position: relative;
        }

        .action-icon:hover {
            background: var(--hover-bg);
            border-color: var(--primary);
            transform: translateY(-1px);
        }

        .action-icon i {
            font-size: 1.1rem;
        }

        .action-icon a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            text-decoration: none;
        }

        .action-icon.ai-credits-pill {
            width: auto;
            padding: 0 12px;
            gap: 6px;
        }

        .action-icon.ai-credits-pill a {
            gap: 6px;
            white-space: nowrap;
        }

        .action-icon.ai-credits-pill i {
            color: #f59e0b;
            font-size: 1.1rem;
        }

        .action-icon.ai-credits-pill .ai-credits-count {
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--text-primary);
        }

        .action-icon.notification i {
            color: #6366f1;
        }

        .action-icon.theme i {
            color: #10b981;
        }

        /* Buttons from screenshots */
        .button {
            padding: 0.5rem 1.25rem;
            border-radius: 8px;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .button-primary {
            background-color: var(--primary-btn-bg);
            color: var(--primary-btn-color);
        }

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

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

        .button-info {
            background-color: var(--info-btn-bg);
            color: var(--info-btn-color);
        }

        .button-warning {
            background-color: var(--warning-btn-bg);
            color: var(--warning-btn-color);
        }

        .button-danger {
            background-color: var(--danger-btn-bg);
            color: var(--danger-btn-color);
        }

        .button-dark {
            background-color: var(--dark-btn-bg);
            color: var(--dark-btn-color);
        }

        /* Upgrade Button */
        .upgrade-button {
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            box-shadow: none;
        }

        .upgrade-button:hover {
            background-color: var(--primary-hover);
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(59, 130, 246, 0.35);
        }

        /* Topbar User Menu */
        .topbar-user-menu {
            position: relative;
        }

        .topbar-user-trigger {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            height: 38px;
            padding: 0 0.9rem;
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            background: var(--glass-bg);
            color: var(--text-primary);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s ease, border-color 0.2s ease;
            white-space: nowrap;
        }

        .topbar-user-trigger:hover {
            background: var(--hover-bg);
            border-color: var(--primary);
        }

        .topbar-user-trigger i:first-child {
            font-size: 1.1rem;
            color: var(--primary);
        }

        .topbar-user-arrow {
            font-size: 0.7rem;
            color: var(--text-muted);
            transition: transform 0.2s ease;
        }

        .topbar-user-menu.open .topbar-user-arrow {
            transform: rotate(180deg);
        }

        .topbar-user-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 200px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: 14px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
            padding: 0.5rem;
            z-index: 1000;
            animation: fadeInUp 0.2s ease-out;
        }

        .topbar-user-menu.open .topbar-user-dropdown {
            display: block;
        }

        .topbar-user-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 0.85rem;
            border-radius: 10px;
            color: var(--text-primary);
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            transition: background 0.15s ease, color 0.15s ease;
        }

        .topbar-user-item:hover {
            background: var(--hover-bg);
            text-decoration: none;
            color: var(--primary);
        }

        .topbar-user-item i {
            font-size: 1rem;
            color: var(--text-muted);
            transition: color 0.15s ease;
        }

        .topbar-user-item:hover i {
            color: var(--primary);
        }

        .topbar-user-divider {
            height: 1px;
            background: var(--border-color);
            margin: 0.35rem 0.5rem;
        }

        .topbar-user-logout {
            color: #ef4444;
        }

        .topbar-user-logout i {
            color: #ef4444;
        }

        .topbar-user-logout:hover {
            background: rgba(239, 68, 68, 0.08);
            color: #dc2626;
        }

        .topbar-user-logout:hover i {
            color: #dc2626;
        }

        .upgrade-button i {
            margin-right: 0.5rem;
        }

        /* Category Tabs */
        .category-tabs {
            display: flex;
            overflow-x: auto;
            margin-bottom: 1.5rem;
            border-bottom: 2px solid var(--border-color);
            scrollbar-width: none;
            padding-bottom: 0;
            gap: 0.5rem;
        }

        .category-tabs::-webkit-scrollbar {
            height: 5px;
        }
        
        .category-tabs::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .category-tabs::-webkit-scrollbar-thumb {
            background-color: rgba(255, 180, 0, 0.3);
            border-radius: 8px;
        }
        
        .category-tabs::-webkit-scrollbar-thumb:hover {
            background-color: var(--primary);
        }

        .category-tab {
            padding: 0.75rem 1.5rem;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            white-space: nowrap;
            position: relative;
            transition: color 0.3s ease;
            border-radius: 0;
            background-color: transparent;
        }

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

        .category-tab.active {
            color: var(--primary);
            font-weight: 600;
            background-color: transparent;
        }

        .category-tab.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--primary);
        }

        /* Tools Section Header */
        .tools-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 1rem;
            margin-top: 2rem;
        }

        .tools-header h2 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            padding: 0.4rem 1.2rem;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.6);
            border: 2px solid rgba(255, 255, 255, 0.9);
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        [data-theme="dark"] .tools-header h2 {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.1);
        }

        .tools-header h2::before {
            content: '';
            position: absolute;
            inset: -3px;
            border-radius: 22px;
            padding: 2px;
            background: conic-gradient(
                from var(--gradient-angle, 0deg),
                transparent 30%,
                var(--primary) 50%,
                transparent 70%
            );
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            opacity: 0;
            transition: opacity 0.3s ease;
            animation: rotateBorder 2.5s linear infinite;
        }

        .tools-header:hover h2::before {
            opacity: 1;
        }

        /* ========== DASHBOARD BANNER ========== */
        .dashboard-banner {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            background: rgba(255, 255, 255, 0.85);
            border: 2.5px solid rgba(255, 255, 255, 0.9);
            border-radius: 18px;
            padding: 1.15rem 1.5rem;
            margin-bottom: 1rem;
            position: relative;
            overflow: hidden;
            z-index: 1;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 24px rgba(100, 130, 200, 0.08);
        }

        [data-theme="dark"] .dashboard-banner {
            background: rgba(255, 255, 255, 0.06);
            border: 2.5px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
        }

        /* Rotating border - uses outline trick since ::before/::after are for blobs */
        .dashboard-banner {
            --banner-accent: #3b82f6;
        }

        .banner-blue { --banner-accent: #3b82f6; }
        .banner-green { --banner-accent: #10b981; }
        .banner-amber { --banner-accent: #f59e0b; }
        .banner-purple { --banner-accent: #8b5cf6; }
        .banner-red { --banner-accent: #ef4444; }

        /* Rotating border glow - replaces the static border */
        .dashboard-banner.has-rotating-border {
            border: none !important;
        }

        .dashboard-banner .banner-border-glow {
            position: absolute;
            inset: 0;
            border-radius: 18px;
            padding: 2.5px;
            background: rgba(255, 255, 255, 0.9);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            z-index: 2;
            pointer-events: none;
            transition: background 0.4s ease;
        }

        .dashboard-banner:hover .banner-border-glow {
            background: conic-gradient(
                from var(--gradient-angle, 0deg),
                rgba(255, 255, 255, 0.9) 0%,
                rgba(255, 255, 255, 0.9) 30%,
                var(--banner-accent) 50%,
                rgba(255, 255, 255, 0.9) 70%,
                rgba(255, 255, 255, 0.9) 100%
            );
            animation: rotateBorder 3s linear infinite;
        }

        [data-theme="dark"] .dashboard-banner .banner-border-glow {
            background: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .dashboard-banner:hover .banner-border-glow {
            background: conic-gradient(
                from var(--gradient-angle, 0deg),
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.1) 30%,
                var(--banner-accent) 50%,
                rgba(255, 255, 255, 0.1) 70%,
                rgba(255, 255, 255, 0.1) 100%
            );
            animation: rotateBorder 3s linear infinite;
        }

        .dashboard-banner:hover {
            transform: translateY(-3px);
            box-shadow: 0 16px 36px rgba(100, 130, 200, 0.15);
        }

        [data-theme="dark"] .dashboard-banner:hover {
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
        }

        /* Bottom-right gradient blob */
        .dashboard-banner::before {
            content: '';
            position: absolute;
            width: 220px;
            height: 220px;
            border-radius: 50%;
            right: -70px;
            bottom: -70px;
            z-index: -1;
            opacity: 0.15;
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            filter: blur(30px);
        }

        /* Top-left gradient blob */
        .dashboard-banner::after {
            content: '';
            position: absolute;
            width: 140px;
            height: 140px;
            border-radius: 50%;
            left: -50px;
            top: -50px;
            z-index: -1;
            opacity: 0.08;
            filter: blur(20px);
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .dashboard-banner:hover::before {
            opacity: 0.35;
            width: 260px;
            height: 260px;
            filter: blur(25px);
        }

        .dashboard-banner:hover::after {
            opacity: 0.18;
            width: 170px;
            height: 170px;
            filter: blur(18px);
        }

        /* Color themes - blobs */
        .banner-blue::before, .banner-blue::after { background: #3b82f6; }
        .banner-green::before, .banner-green::after { background: #10b981; }
        .banner-amber::before, .banner-amber::after { background: #f59e0b; }
        .banner-purple::before, .banner-purple::after { background: #8b5cf6; }
        .banner-red::before, .banner-red::after { background: #ef4444; }

        /* Icon container */
        .banner-icon-wrap {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .dashboard-banner:hover .banner-icon-wrap {
            transform: scale(1.06);
        }

        .banner-icon-wrap i {
            font-size: 1.4rem;
        }

        .banner-icon-wrap .banner-img {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            object-fit: cover;
        }

        /* Color themes - icon */
        .banner-blue .banner-icon-wrap { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
        .banner-green .banner-icon-wrap { background: rgba(16, 185, 129, 0.12); color: #10b981; }
        .banner-amber .banner-icon-wrap { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
        .banner-purple .banner-icon-wrap { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
        .banner-red .banner-icon-wrap { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

        /* Content */
        .banner-content {
            flex: 1;
            min-width: 0;
        }

        .banner-heading {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 2px 0;
            line-height: 1.3;
        }

        .banner-tagline {
            font-size: 0.82rem;
            color: var(--text-secondary);
            margin: 0;
            line-height: 1.4;
        }

        /* CTA Button */
        .banner-cta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0.6rem 1.35rem;
            border-radius: 12px;
            font-size: 0.82rem;
            font-weight: 600;
            color: #fff !important;
            text-decoration: none !important;
            white-space: nowrap;
            flex-shrink: 0;
            transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .banner-cta i {
            font-size: 0.9rem;
            transition: transform 0.3s ease;
        }

        .banner-cta:hover i {
            transform: translate(2px, -2px);
        }

        .banner-cta:hover {
            transform: translateY(-2px);
            filter: brightness(1.1);
        }

        /* Shimmer effect on CTA */
        .banner-cta::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.6s ease;
        }

        .dashboard-banner:hover .banner-cta::before {
            left: 100%;
        }

        /* Color themes - CTA */
        .banner-blue .banner-cta { background: #3b82f6; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3); }
        .banner-green .banner-cta { background: #10b981; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); }
        .banner-amber .banner-cta { background: #f59e0b; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3); }
        .banner-purple .banner-cta { background: #8b5cf6; box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3); }
        .banner-red .banner-cta { background: #ef4444; box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3); }

        .banner-blue .banner-cta:hover { box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4); }
        .banner-green .banner-cta:hover { box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4); }
        .banner-amber .banner-cta:hover { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4); }
        .banner-purple .banner-cta:hover { box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4); }
        .banner-red .banner-cta:hover { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4); }

        /* Color themes - heading accent */
        .banner-blue .banner-heading { color: var(--text-primary); }
        .banner-green .banner-heading { color: var(--text-primary); }
        .banner-amber .banner-heading { color: var(--text-primary); }
        .banner-purple .banner-heading { color: var(--text-primary); }
        .banner-red .banner-heading { color: var(--text-primary); }

        /* Responsive */
        @media (max-width: 640px) {
            .dashboard-banner {
                flex-direction: column;
                text-align: center;
                padding: 1.25rem;
                gap: 0.75rem;
            }

            .banner-content {
                order: 2;
            }

            .banner-cta {
                order: 3;
                width: 100%;
                justify-content: center;
            }
        }

        /* Premium Stats Section */
        .stats-section {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.85);
            border: 2.5px solid rgba(255, 255, 255, 0.9);
            border-radius: 18px;
            padding: 1rem 1.1rem;
            box-shadow: 0 4px 24px rgba(100, 130, 200, 0.08);
            position: relative;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            height: 120px;
            display: flex;
            z-index: 1;
        }

        [data-theme="dark"] .stat-card {
            background: rgba(255, 255, 255, 0.06);
            border: 2.5px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
        }

        /* Subtle corner gradient blob */
        .stat-card::before {
            content: '';
            position: absolute;
            width: 180px;
            height: 180px;
            border-radius: 50%;
            right: -60px;
            bottom: -60px;
            z-index: -1;
            opacity: 0.15;
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            filter: blur(30px);
        }

        .stat-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 16px 36px rgba(100, 130, 200, 0.15);
            border-color: rgba(255, 255, 255, 1);
        }

        [data-theme="dark"] .stat-card:hover {
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
            border-color: rgba(255, 255, 255, 0.15);
        }

        /* Hide original click-hint */
        .click-hint {
            display: none !important;
        }

        /* Floating tooltip (appended to body via JS) */
        .switch-tooltip {
            position: fixed;
            background: rgba(26, 35, 64, 0.92);
            color: #fff;
            font-size: 0.65rem;
            padding: 0.3rem 0.6rem;
            border-radius: 8px;
            white-space: nowrap;
            z-index: 9999;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .switch-tooltip.visible {
            opacity: 1;
        }

        .stat-card:hover::before {
            opacity: 0.35;
            width: 220px;
            height: 220px;
            filter: blur(25px);
        }

        /* Tool Card - Indigo */
        .stat-card.tools::before {
            background: #6366f1;
        }

        .stat-card.tools .stat-icon {
            background-color: rgba(99, 102, 241, 0.12);
            color: var(--tools-color);
        }

        /* Expiry Card - Emerald */
        .stat-card.expiry::before {
            background: #10b981;
        }

        .stat-card.expiry .stat-icon {
            background-color: rgba(16, 185, 129, 0.12);
            color: var(--expiry-color);
        }

        /* Subscription Card - Amber */
        .stat-card.subscription::before {
            background: #f59e0b;
        }

        .stat-card.subscription .stat-icon {
            background-color: rgba(245, 158, 11, 0.12);
            color: var(--subscription-color);
        }

        /* Content Layout */
        .stat-left {
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex: 1;
            min-width: 0;
        }

        .stat-right {
            width: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            padding-left: 0.75rem;
            position: relative;
        }

        .stat-header {
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--text-muted);
            margin-bottom: 0.35rem;
            display: flex;
            align-items: center;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.35rem;
            line-height: 1.1;
            position: relative;
            color: var(--text-primary);
        }

        .stat-card.tools .stat-value {
            color: var(--tools-color);
        }

        .stat-card.expiry .stat-value {
            color: var(--expiry-color);
        }

        .stat-card.subscription .stat-value {
            color: var(--subscription-color);
            font-size: 1.35rem;
        }

        .stat-footer {
            font-size: 0.72rem;
            font-weight: 500;
            color: var(--text-secondary);
        }

        /* Badge-style footer items */
        .stat-footer.with-icon,
        .stat-footer:not(:has(.badge)) {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.25rem 0.65rem;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.6);
            border: 1.5px solid transparent;
            position: relative;
            transition: border-color 0.3s ease;
            font-size: 0.68rem;
            font-weight: 600;
            width: fit-content;
        }

        [data-theme="dark"] .stat-footer.with-icon,
        [data-theme="dark"] .stat-footer:not(:has(.badge)) {
            background: rgba(255, 255, 255, 0.06);
        }

        /* Rotating gradient border on hover */
        .stat-footer.with-icon::before,
        .stat-footer:not(:has(.badge))::before {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 22px;
            padding: 1.5px;
            background: conic-gradient(
                from var(--gradient-angle, 0deg),
                transparent 40%,
                var(--footer-accent, #f59e0b) 50%,
                transparent 60%
            );
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stat-card:hover .stat-footer.with-icon::before,
        .stat-card:hover .stat-footer:not(:has(.badge))::before {
            opacity: 1;
            animation: rotateBorder 2s linear infinite;
        }

        @property --gradient-angle {
            syntax: '<angle>';
            initial-value: 0deg;
            inherits: false;
        }

        @keyframes rotateBorder {
            to { --gradient-angle: 360deg; }
        }

        /* Card-specific accent colors */
        .stat-card.subscription .stat-footer { --footer-accent: #f59e0b; }
        .stat-card.expiry .stat-footer { --footer-accent: #10b981; }
        .stat-card.tools .stat-footer { --footer-accent: #6366f1; }

        /* Badge styles inside stat-footer */
        .stat-footer .badge {
            padding: 0.25rem 0.65rem;
            border-radius: 20px;
            font-size: 0.65rem;
            font-weight: 600;
            background: rgba(255, 255, 255, 0.6);
            border: 1.5px solid transparent;
            position: relative;
            transition: border-color 0.3s ease;
            display: inline-flex;
            align-items: center;
        }

        [data-theme="dark"] .stat-footer .badge {
            background: rgba(255, 255, 255, 0.06);
        }

        .stat-footer .badge::before {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 22px;
            padding: 1.5px;
            background: conic-gradient(
                from var(--gradient-angle, 0deg),
                transparent 40%,
                var(--footer-accent, #10b981) 50%,
                transparent 60%
            );
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stat-card:hover .stat-footer .badge::before {
            opacity: 1;
            animation: rotateBorder 2s linear infinite;
        }

        .stat-footer .badge.badge-success { color: #10b981; }
        .stat-footer .badge.badge-danger { color: #ef4444; }
        .stat-footer .badge.badge-primary { color: #3b82f6; }

        .stat-footer .checkmark { color: #10b981; font-size: 0.7rem; }

        .stat-indicator {
            position: absolute;
            top: 0.6rem;
            right: 0.6rem;
            display: inline-flex;
            align-items: center;
            font-weight: 600;
            padding: 0.2rem 0.5rem;
            border-radius: 0.5rem;
            font-size: 0.6rem;
            margin: 0;
            z-index: 2;
        }

        .plan-counter {
            position: absolute;
            top: 0.6rem;
            right: 0.6rem;
            display: inline-flex;
            align-items: center;
            font-weight: 600;
            padding: 0.2rem 0.5rem;
            border-radius: 0.5rem;
            font-size: 0.6rem;
            margin: 0;
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
            z-index: 2;
        }

        [data-theme="dark"] .plan-counter {
            background: rgba(255, 180, 0, 0.15);
            color: #FFB400;
        }

        .stat-indicator.positive {
            background-color: rgba(16, 185, 129, 0.1);
            color: #10b981;
        }

        .stat-indicator i {
            margin-right: 0.25rem;
            font-size: 0.7rem;
        }

        .stat-footer.with-icon {
            display: flex;
            align-items: center;
        }

        .stat-footer i {
            margin-right: 0.35rem;
        }

        .stat-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .stat-card:hover .stat-icon {
            transform: scale(1.06);
        }

        .stat-icon i {
            font-size: 1.15rem;
        }

        /* Top-left subtle gradient accent */
        .stat-card::after {
            content: '';
            position: absolute;
            width: 120px;
            height: 120px;
            border-radius: 50%;
            left: -40px;
            top: -40px;
            z-index: -1;
            opacity: 0.08;
            filter: blur(20px);
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .stat-card:hover::after {
            opacity: 0.18;
            width: 150px;
            height: 150px;
            filter: blur(18px);
        }

        .stat-card.tools::after {
            background: #6366f1;
        }

        .stat-card.expiry::after {
            background: #10b981;
        }

        .stat-card.subscription::after {
            background: #f59e0b;
        }

        .checkmark {
            color: #10b981;
        }

        /* Progress Bar for Expiry */
        .progress-container {
            width: 100%;
            height: 5px;
            background-color: rgba(0, 0, 0, 0.05);
            border-radius: 3px;
            margin-top: 5px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            border-radius: 3px;
            background: linear-gradient(90deg, #10b981, #34d399);
            width: 20%; /* This would be dynamically set based on days left */
        }

        /* Tools Grid — styles now in member-main-resources.phtml template */
        /* Override alert-primary wrapper inside tools section */
        .tools-header .alert-primary,
        .tools-header .alert.alert-primary {
            background: none !important;
            border: none !important;
            padding: 0 !important;
            margin: 0 !important;
            color: inherit !important;
        }

        .tools-header .card-body {
            padding: 0;
            width: 100%;
            align-self: stretch;
        }

        /* Mobile Menu Controls */
        .mobile-menu-toggle {
            display: none;
            background: var(--card-bg);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 5px var(--shadow-color);
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 99;
        }

        .mobile-menu-toggle i {
            color: var(--primary);
            font-size: 1.25rem;
        }

        /* Sidebar Toggle Button - Now moved inside the sidebar */
        .sidebar-toggle {
            background-color: var(--primary);
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
            border: 3px solid var(--background);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
            font-size: 0.75rem;
        }

        [data-theme="dark"] .sidebar-toggle {
            border-color: var(--background);
            box-shadow: 0 4px 12px rgba(255, 180, 0, 0.3);
        }

        .sidebar-toggle:hover {
            background-color: var(--primary-hover);
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
        }

        [data-theme="dark"] .sidebar-toggle:hover {
            box-shadow: 0 6px 16px rgba(255, 180, 0, 0.4);
        }

        /* Mobile Nav Overlay */
        .mobile-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 99;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }

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

        /* Responsive Styles */
        @media (max-width: 1200px) {
            /* tools-grid responsive handled in template */
        }

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

        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: -300px;
                width: 280px;
                height: 100%;
                z-index: 1000;
                top: 0;
                background: rgba(230, 237, 246, 0.95);
                backdrop-filter: blur(20px);
                -webkit-backdrop-filter: blur(20px);
            }

            [data-theme="dark"] .sidebar {
                background: rgba(15, 23, 42, 0.95);
            }
            
            .sidebar.active {
                left: 0;
            }
            
            .sidebar.expanded {
                width: 280px;
            }
            
            .sidebar.expanded ~ .main-content {
                margin-left: 0;
            }
            
            .main-content {
                margin-left: 5px;
                margin-right: 5px;
                margin-top: 5px;
                margin-bottom: 5px;
                padding: 1rem;
                padding-top: 3.5rem; /* Add padding to accommodate the fixed menu toggle */
                border-radius: 20px;
            }
            
            .mobile-menu-toggle {
                display: flex;
            }
            
            .search-container {
                max-width: 100%;
                margin: 0;
            }
            
            .topbar {
                flex-direction: column;
                align-items: stretch;
            }
            
            .topbar-actions {
                justify-content: flex-end;
                width: 100%;
            }
            
            .welcome-title {
                width: 100%;
                text-align: center;
            }

            /* Hide "Active Subscriptions" heading on mobile */
            .tools-header h2 {
                display: none;
            }
            
            .stats-section {
                display: flex;
                overflow-x: auto;
                scroll-snap-type: x mandatory;
                gap: 1rem;
                padding-bottom: 4px;
                scrollbar-width: none;
                -ms-overflow-style: none;
            }
            .stats-section::-webkit-scrollbar { display: none; }
            .stats-section .stat-card {
                min-width: 280px;
                flex-shrink: 0;
                scroll-snap-align: start;
            }
            
            /* Show mobile menu actions section */
            .mobile-menu-actions {
                display: block;
            }
            
            /* Hide sidebar toggle in mobile mode */
            .sidebar-toggle-container {
                display: none;
            }
            
            /* Show mobile close button */
            .mobile-menu-close {
                display: flex;
            }
            
            /* Hide topbar buttons on mobile */
            .topbar .action-icon.theme,
            .topbar .action-icon.notification,
            .topbar .upgrade-button,
            .topbar .topbar-user-menu {
                display: none;
            }
        }

        @media (max-width: 576px) {
            .welcome-title h1 {
                font-size: 1.5rem;
            }
            
            .main-content {
                padding: 0.75rem;
                padding-top: 3.5rem; /* Keep consistent padding for menu toggle */
                margin-left: 5px;
                margin-right: 5px;
                border-radius: 18px;
            }
            
            .tool-image {
                height: 70px;
            }
            
            .tool-name {
                font-size: 0.9rem;
            }
            
            .access-button {
                font-size: 0.85rem;
                padding: 0.5rem;
            }
            
            .upgrade-button {
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
            }
            
            .tools-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
        }

        @media (max-width: 400px) {
            .topbar-actions {
                flex-wrap: wrap;
                justify-content: space-between;
                gap: 0.5rem;
            }
            
            .welcome-title p {
                font-size: 0.85rem;
            }
            
            .category-tabs {
                gap: 0.25rem;
            }
            
            .category-tab {
                padding: 0.5rem 1rem;
                font-size: 0.85rem;
            }
        }

        h2#member-main-subscriptions-head {
            display: none !important;
        }
      /* Profile Page Layout */
.profile-page-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

/* Profile Header Card */
.profile-header-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.profile-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
    pointer-events: none;
}

.profile-header-avatar {
    flex-shrink: 0;
    position: relative;
}

.profile-header-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    object-fit: cover;
    display: block;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.avatar-upload-overlay:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.avatar-upload-overlay i {
    font-size: 0.75rem;
    color: white;
}

[data-theme="dark"] .avatar-upload-overlay {
    background: var(--primary);
    border-color: var(--background);
}

[data-theme="dark"] .avatar-upload-overlay:hover {
    background: var(--primary-hover);
}

.profile-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.profile-header-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.profile-header-username {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    width: fit-content;
}

/* Profile Form Section */
.profile-form-section {
    position: relative;
}

.profile-form-header {
    margin-bottom: 1rem;
}

.profile-form-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.profile-form-title i {
    font-size: 1.3rem;
    color: var(--primary);
}

.profile-form-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-form-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    padding-left: 1.8rem;
}

/* Base Form Card */
.am-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin: 0;
    transition: box-shadow 0.3s ease;
}

.am-form:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.am-profile-form {
    max-width: 700px;
    margin: 0 auto;
}

/* Row styling */
.am-row {
    margin-bottom: 1.75rem;
    position: relative;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.am-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Element title styling */
.am-element-title {
    margin-bottom: 0.75rem;
}

.am-element-title label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.am-element-title label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background-color: var(--primary);
    border-radius: 2px;
}

.am-element-title .required {
    color: var(--primary);
    font-weight: 700;
}

.am-element-title .comment {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
    line-height: 1.4;
    padding-left: 0.75rem;
}

/* Input field styling */
.am-element input[type="text"],
.am-element input[type="password"],
.am-element input[type="email"],
.am-element select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: var(--card-bg);
    color: var(--text-primary);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    font-family: inherit;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
}

[data-theme="dark"] .am-element input[type="text"],
[data-theme="dark"] .am-element input[type="password"],
[data-theme="dark"] .am-element input[type="email"],
[data-theme="dark"] .am-element select {
    border-color: var(--border-color);
}

.am-element input[type="text"]:hover,
.am-element input[type="password"]:hover,
.am-element input[type="email"]:hover,
.am-element select:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.am-element input[type="text"]:focus,
.am-element input[type="password"]:focus,
.am-element input[type="email"]:focus,
.am-element select:focus {
    outline: none;
    border-color: transparent;
    background-color: var(--card-bg);
}

/* Rotating border wrapper for focused inputs */
.input-glow-wrap {
    position: relative;
}

.input-glow {
    display: none;
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        rgba(59, 130, 246, 0.15) 0%,
        rgba(59, 130, 246, 0.15) 30%,
        #3b82f6 50%,
        rgba(59, 130, 246, 0.15) 70%,
        rgba(59, 130, 246, 0.15) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
    animation: rotateBorder 2.5s linear infinite;
}

[data-theme="dark"] .input-glow {
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        rgba(255, 180, 0, 0.1) 0%,
        rgba(255, 180, 0, 0.1) 30%,
        var(--primary) 50%,
        rgba(255, 180, 0, 0.1) 70%,
        rgba(255, 180, 0, 0.1) 100%
    );
}

.input-glow.active {
    display: block;
}

/* Placeholder styling */
.am-element input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Group element styling (for name fields) */
.am-element.group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.am-element.group input,
.am-element.group select {
    width: 100%;
}

/* Wide element styling */
.am-el-wide {
    width: 100% !important;
}

/* Select dropdown styling */
.am-element select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' 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 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
    cursor: pointer;
}

.am-element select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFB400' 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");
}

/* Dark theme support for select dropdown */
[data-theme="dark"] .am-element select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccc' 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");
}

[data-theme="dark"] .am-element select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFB400' 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");
}

/* State group styling */
#row-grp-state .am-element.group {
    display: block;
}

#row-grp-state .am-element.group select,
#row-grp-state .am-element.group input {
    width: 100%;
    margin-bottom: 0;
}

#row-grp-state select[disabled],
#row-grp-state input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--hover-bg);
}

/* Fieldset styling (Address Information) */
fieldset {
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin: 0.5rem 0 1rem;
    background-color: rgba(59, 130, 246, 0.02);
    transition: border-color 0.3s ease;
}

[data-theme="dark"] fieldset {
    background-color: rgba(59, 130, 246, 0.04);
}

fieldset:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

fieldset legend {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    border: none;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fieldset {
    margin: 0;
}

/* Rows inside fieldset — no border separator */
fieldset .am-row {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
}

/* Change password toggle link */
.am-change-pass-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border: 1.5px solid rgba(239, 68, 68, 0.15);
    cursor: pointer;
}

.am-change-pass-toggle:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    text-decoration: none;
    color: #dc2626;
}

.am-change-pass-toggle::before {
    content: 'Change Password';
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.am-change-pass-toggle::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' 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-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Rotate arrow when password section is expanded */
.am-change-pass-toggle.expanded::after {
    transform: rotate(180deg);
}

/* Password fields - smooth transitions */
#row-_oldpass-0,
#row-pass-0,
#row-pass-confirm {
    transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease, margin-bottom 0.4s ease;
    overflow: visible;
}

/* Hide password fields initially if they have display:none */
#row-_oldpass-0[style*="display: none"],
#row-pass-0[style*="display: none"],
#row-pass-confirm[style*="display: none"] {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    transform: translateY(-10px);
}

/* Show password fields when visible */
#row-_oldpass-0[style=""],
#row-pass-0[style=""],
#row-pass-confirm[style=""] {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 1.5rem;
    transform: translateY(0);
    animation: slideDownFade 0.4s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* Password fields styling — red accent */
.am-change-pass {
    transition: opacity 0.3s ease;
}

#row-_oldpass-0,
#row-pass-0,
#row-pass-confirm {
    border-bottom-color: rgba(239, 68, 68, 0.1);
}

#row-_oldpass-0 .am-element-title label::before,
#row-pass-0 .am-element-title label::before,
#row-pass-confirm .am-element-title label::before {
    background-color: #dc2626;
}

#row-_oldpass-0 .am-element-title label,
#row-pass-0 .am-element-title label,
#row-pass-confirm .am-element-title label {
    color: #dc2626;
}

#row-_oldpass-0 .am-element input,
#row-pass-0 .am-element input,
#row-pass-confirm .am-element input {
    border-color: rgba(239, 68, 68, 0.2);
}

#row-_oldpass-0 .am-element input:focus,
#row-pass-0 .am-element input:focus,
#row-pass-confirm .am-element input:focus {
    border-color: transparent;
}

#row-_oldpass-0 .input-glow,
#row-pass-0 .input-glow,
#row-pass-confirm .input-glow {
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        rgba(239, 68, 68, 0.1) 0%,
        rgba(239, 68, 68, 0.1) 30%,
        #dc2626 50%,
        rgba(239, 68, 68, 0.1) 70%,
        rgba(239, 68, 68, 0.1) 100%
    ) !important;
}

/* Submit button styling — Blue in light, primary in dark */
.am-cta-profile {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1rem 2rem !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease !important;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3) !important;
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    margin: 0 auto;
    display: block;
    background-image: none;
}

[data-theme="dark"] .am-cta-profile {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
    box-shadow: 0 8px 16px rgba(255, 180, 0, 0.3) !important;
}

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

.am-cta-profile:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .am-cta-profile:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%) !important;
    box-shadow: 0 12px 24px rgba(255, 180, 0, 0.4) !important;
}

.am-cta-profile:hover::before {
    left: 100%;
}

.am-cta-profile:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.am-cta-profile:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* Hidden fields */
input[type="hidden"] {
    display: none;
}

/* Form validation states */
.am-element input.error,
.am-element select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.am-element input.success,
.am-element select.success {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Loading state for submit button */
.am-cta-profile.loading {
    pointer-events: none;
    opacity: 0.7;
}

.am-cta-profile.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.am-error {
    color: #ff0000;
}
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}



/* Responsive design */
@media (max-width: 768px) {
    .profile-page-wrapper {
        padding: 0 0 1.5rem;
    }

    .profile-header-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        border-radius: 14px;
    }

    .profile-header-info {
        align-items: center;
    }

    .profile-header-name {
        font-size: 1.25rem;
    }

    .profile-form-subtitle {
        padding-left: 0;
    }

    .am-form {
        padding: 1.5rem;
        margin: 0;
        border-radius: 12px;
    }
    
    .am-element.group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    fieldset {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    fieldset legend {
        margin-left: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .am-element input[type="text"],
    .am-element input[type="password"],
    .am-element input[type="email"],
    .am-element select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .am-cta-profile {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        max-width: none;
        width: 100%;
    }
    
    .am-element-title label {
        font-size: 0.9rem;
    }
    
    .am-element-title .comment {
        font-size: 0.75rem;
    }
    
    .am-change-pass-toggle {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .profile-header-card {
        padding: 1.25rem;
    }

    .profile-header-avatar img {
        width: 64px;
        height: 64px;
    }

    .am-form {
        padding: 1rem;
        margin: 0;
    }

    .am-row {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    fieldset {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    .am-element input[type="text"],
    .am-element input[type="password"],
    .am-element input[type="email"],
    .am-element select {
        padding: 0.625rem;
        border-radius: 8px;
    }

    .am-element-title label {
        font-size: 0.8rem;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .am-form {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .am-form:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .profile-header-card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .profile-header-avatar img {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(255, 180, 0, 0.2);
}
/* ========================================
   Payment History Page — Redesigned
   ======================================== */

/* Page Header — Badge Style */
.payment-history-page-header {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.billing-history-badge {
    position: relative;
    display: inline-flex;
    border-radius: 20px;
    padding: 2px;
}

.billing-badge-glow {
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 2px;
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        transparent 30%,
        #6366f1 50%,
        transparent 70%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateBorder 2.5s linear infinite;
    pointer-events: none;
}

[data-theme="dark"] .billing-badge-glow {
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        transparent 30%,
        var(--primary) 50%,
        transparent 70%
    );
}

.billing-badge-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 18px;
    background: var(--glass-bg);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.billing-badge-content i {
    font-size: 1rem;
    color: #6366f1;
}

[data-theme="dark"] .billing-badge-content i {
    color: #a5b4fc;
}

/* Section Headers (Subscriptions & Payments) */
.subscription-section-header,
.payment-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.subscription-section-icon,
.payment-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subscription-section-icon {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(236, 72, 153, 0.04));
}

.subscription-section-icon i {
    font-size: 1.25rem;
    color: #ec4899;
}

[data-theme="dark"] .subscription-section-icon i {
    color: #f9a8d4;
}

.payment-section-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.04));
}

.payment-section-icon i {
    font-size: 1.25rem;
    color: #6366f1;
}

[data-theme="dark"] .payment-section-icon i {
    color: #a5b4fc;
}

.subscription-section-header h2,
.payment-section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.subscription-section-desc,
.payment-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0;
}

/* Active Subscriptions Block */
#am-block-active-subscriptions {
    padding: 0;
    margin-top: 1rem;
}

/* ========================================
   Invoice Cards
   ======================================== */
.invoice-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out both;
}

.invoice-card:nth-child(2) { animation-delay: 0.1s; }
.invoice-card:nth-child(3) { animation-delay: 0.2s; }
.invoice-card:nth-child(4) { animation-delay: 0.3s; }

.invoice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(31, 63, 195, 0.12);
}

/* Invoice Card Header */
.invoice-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(99, 102, 241, 0.03);
}

.invoice-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.invoice-badge-separator {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.invoice-badge {
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.invoice-badge-id {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

[data-theme="dark"] .invoice-badge-id {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.invoice-badge-date {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .invoice-badge-date {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
}

.invoice-badge-paysys {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .invoice-badge-paysys {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}

.invoice-badge-terms {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-weight: 700;
}

[data-theme="dark"] .invoice-badge-terms {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Invoice Card Products */
.invoice-card-products {
    padding: 1.25rem 1.5rem;
}

.invoice-product-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem 0;
}

.invoice-product-item + .invoice-product-item {
    border-top: 1px solid var(--border-color);
}

.invoice-product-check {
    color: #22c55e;
    font-size: 1.1rem;
    flex-shrink: 0;
}

[data-theme="dark"] .invoice-product-check {
    color: #4ade80;
}

.invoice-product-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.invoice-action-upgrade {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b5cf6;
    text-decoration: none;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: background 0.2s ease, color 0.2s ease;
}

.invoice-action-upgrade:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    text-decoration: none;
}

.invoice-product-option {
    width: 100%;
    padding-left: 1.7rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.invoice-option-price {
    color: var(--text-muted);
}

/* Invoice Card Footer (Rebill & Actions) */
.invoice-card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(99, 102, 241, 0.02);
}

.invoice-rebill-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.invoice-rebill-label {
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-rebill-date {
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-rebill-date.am-error {
    color: #ef4444;
}

.invoice-status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
}

.invoice-status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .invoice-status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.invoice-status-failed {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .invoice-status-failed {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Invoice Action Buttons */
.invoice-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.invoice-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

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

.invoice-action-btn i {
    font-size: 0.9rem;
}

.invoice-action-cancel {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.invoice-action-cancel:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .invoice-action-cancel {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
}

.invoice-action-renew {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.invoice-action-renew:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #2563eb;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .invoice-action-renew {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.invoice-action-restore {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.invoice-action-restore:hover {
    background: rgba(16, 185, 129, 0.18);
    color: #059669;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .invoice-action-restore {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.invoice-action-update {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

.invoice-action-update:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .invoice-action-update {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.25);
}

/* ========================================
   Payment History — Card Rows
   ======================================== */
#am-block-payments {
    padding: 0;
    margin-top: 1.5rem;
}

.payment-rows-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.4s ease-out both;
}

.payment-row:nth-child(2) { animation-delay: 0.05s; }
.payment-row:nth-child(3) { animation-delay: 0.1s; }
.payment-row:nth-child(4) { animation-delay: 0.15s; }
.payment-row:nth-child(5) { animation-delay: 0.2s; }

.payment-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--glass-border);
}

/* Payment Icon */
.payment-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.payment-icon-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

[data-theme="dark"] .payment-icon-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.payment-icon-refund {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

[data-theme="dark"] .payment-icon-refund {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Payment Info */
.payment-info {
    flex: 1;
    min-width: 0;
}

.payment-info-primary {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-info-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.pay-badge i {
    font-size: 0.7rem;
}

.pay-badge-date {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .pay-badge-date {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.pay-badge-invoice {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .pay-badge-invoice {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.pay-badge-method {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .pay-badge-method {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.payment-invoice-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s ease;
}

.payment-invoice-link:hover {
    opacity: 0.8;
    color: inherit;
    text-decoration: none;
}

.pay-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    margin-left: 2px;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.pay-download-btn:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
    color: #059669;
    text-decoration: none;
}

[data-theme="dark"] .pay-download-btn {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
}

.pay-download-btn i {
    font-size: 0.65rem;
}

.payment-info-secondary {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.payment-info-dot {
    font-size: 0.6rem;
}

.payment-info-paysys {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Payment Amount */
.payment-amount {
    font-weight: 700;
    font-size: 1.05rem;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.payment-amount-success {
    color: #22c55e;
}

[data-theme="dark"] .payment-amount-success {
    color: #4ade80;
}

.payment-amount-refund {
    color: #ef4444;
}

[data-theme="dark"] .payment-amount-refund {
    color: #fca5a5;
}

.payment-refund-note {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ef4444;
    margin-top: 0.2rem;
}

[data-theme="dark"] .payment-refund-note {
    color: #fca5a5;
}

/* No Data */
.am-block-nodata {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Cancel Subscription Popup Enhancement */
.cancel-subscription-popup {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    border: 1px solid var(--glass-border);
}

.cancel-subscription-popup-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.cancel-subscription-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.am-cta-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.am-cta-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .am-cta-cancel {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.am-popup-close {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
}

.am-popup-close:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

[data-theme="dark"] .am-popup-close {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

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

/* Focus states for accessibility */
.invoice-action-btn:focus,
.payment-invoice-link:focus,
.am-cta-cancel:focus,
.am-popup-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   Responsive — Payment History
   ======================================== */
@media (max-width: 768px) {
    #am-block-active-subscriptions,
    #am-block-payments {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .invoice-card-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 1.25rem;
    }

    .invoice-card-products,
    .invoice-card-footer {
        padding: 1rem 1.25rem;
    }

    .invoice-card-actions {
        flex-wrap: wrap;
    }

    .payment-row {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .payment-amount {
        width: 100%;
        text-align: left;
        padding-left: 3.5rem;
        font-size: 1rem;
    }

    .cancel-subscription-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #am-block-active-subscriptions,
    #am-block-payments {
        padding: 1rem;
    }

    .invoice-card-header {
        padding: 0.85rem 1rem;
    }

    .invoice-card-products,
    .invoice-card-footer {
        padding: 0.85rem 1rem;
    }

    .invoice-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    .payment-row {
        padding: 0.85rem 1rem;
    }

    .payment-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .payment-amount {
        padding-left: 3rem;
    }
}

[data-theme="dark"] #no-plan-alert {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px;
    color: #f5f5f5 !important;
}

[data-theme="dark"] #no-plan-alert a.button-primary {
    background-color: #FFB400 !important;
    color: #ffffff !important;
}
/* Apply same styling to input submit button */
input[type="submit"]#_save-0 {
    all: unset;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 8px 16px rgba(255, 180, 0, 0.3);
    text-transform: none;
    letter-spacing: 0.5px;
    font-family: inherit;
    margin: 0 auto;
    display: block;
    position: relative;
    text-align: center;
}

input[type="submit"]#_save-0:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(255, 180, 0, 0.4);
}

input[type="submit"]#_save-0:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(255, 180, 0, 0.3);
}

input[type="submit"]#_save-0:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-light), 0 8px 16px rgba(255, 180, 0, 0.3);
}

/* Loading state for both buttons */
.am-element.loading,
input[type="submit"].loading {
    pointer-events: none;
    opacity: 0.7;
}

.am-element.loading::after,
input[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

/* Spinner animation */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error text */
.am-error {
    color: #ff0000;
}
/* Component variables (helpdesk/forms) */
:root {
  --bg-color: #d6e8f5;
  --card-bg: rgba(255, 255, 255, 0.55);
  --text-primary: #1a2340;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.5);
  --info-bg: rgba(255, 255, 255, 0.4);
  --hover-bg: rgba(255, 255, 255, 0.4);
  --shadow-color: rgba(100, 130, 200, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(100, 130, 200, 0.12);
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --card-bg: rgba(20, 25, 55, 0.7);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.06);
  --info-bg: rgba(255, 255, 255, 0.04);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Container */
.helpdesk-page.container-xxl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Info banner */
.am-info {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px 15px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Grid wrapper */
.am-grid-wrap {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: box-shadow 0.3s ease;
}

/* Title */
.am-grid-title {
  font-size: 24px;
  margin: 10px 10px 10px 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.am-grid-title-desc {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: normal;
}

/* Filter */
.am-filter-wrap {
  padding: 15px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--border-color);
}

.filter {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 14px;
  width: 250px;
  background: var(--glass-bg);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.filter input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter input[type="text"]::placeholder {
  color: var(--text-muted);
}

.gridFilterButton {
  padding: 8px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gridFilterButton:hover {
  background: #0056b3;
}

/* New ticket button */
.am-norecord-actions {
  padding: 15px;
  text-align: right;
  background: var(--card-bg);
}

.button {
  background: #28a745;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.button:hover {
  background: #218838;
  color: white;
  text-decoration: none;
}

/* Table */
.am-grid-container {
  overflow-x: auto;
  background: var(--card-bg);
}

.am-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card-bg);
}

.am-grid th {
  background: var(--info-bg);
  padding: 12px 8px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
}

.am-grid th a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.am-grid th a:hover {
  color: #007bff;
}

.am-grid td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-secondary);
  background: var(--card-bg);
  transition: background-color 0.3s ease;
}

.am-grid-row.even td {
  background: var(--hover-bg);
}

.am-grid-row:hover td {
  background: var(--hover-bg);
}

.am-grid-row.disabled {
  opacity: 0.6;
}

/* Subject column */
.am-helpdesk-grid-subject .link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.am-helpdesk-grid-subject .link:hover {
  color: #0056b3;
}

.am-helpdesk-grid-msg-cnt {
  background: #6c757d;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 5px;
}

.am-helpdesk-grid-msg {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 5px;
}

/* Time */
time {
  color: var(--text-muted);
  font-size: 13px;
}

/* Status icons with colors */
.glyph {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 50%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Status color mapping based on title attribute */
.glyph[title="New"],
.glyph[alt="New"] {
  background-color: #007bff;
}

.glyph[title="Awaiting Admin Response"],
.glyph[alt="Awaiting Admin Response"] {
  background-color: #dc3545;
}

.glyph[title="Awaiting User Response"],
.glyph[alt="Awaiting User Response"] {
  background-color: #ffc107;
}

.glyph[title="Closed"],
.glyph[alt="Closed"] {
  background-color: #28a745;
}

.am-grid-row:hover .glyph {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark mode adjustments */
[data-theme="dark"] .am-helpdesk-grid-msg-cnt {
  background: #495057;
}

[data-theme="dark"] .am-helpdesk-grid-subject .link {
  color: #4dabf7;
}

[data-theme="dark"] .am-helpdesk-grid-subject .link:hover {
  color: #74c0fc;
}

/* Status Legend */
.status-legend {
  margin-top: 20px;
  padding: 15px;
  background: var(--glass-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.status-legend h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.new {
  background-color: #007bff;
}

.legend-dot.pending {
  background-color: #dc3545;
}

.legend-dot.awaiting {
  background-color: #ffc107;
}

.legend-dot.closed {
  background-color: #28a745;
}
/* Add Attachments Link */
.am-helpdesk-attachment-expand {
  display: none;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--info-bg);
  color: #007bff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.am-helpdesk-attachment-expand:hover {
  background: #007bff;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.am-helpdesk-attachment-expand:before {
  content: '📎';
  margin-right: 0.5rem;
  font-size: 12px;
}

/* Upload Control - Hidden by default */
.upload-control {
  margin-top: 0.75rem;
  display: none;
}

/* When attachment row is shown, display upload control */
.am-row[id*="attachments"]:not([style*="display: none"]) .upload-control {
  display: block;
}

.upload-control-upload {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.upload-control-upload:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.upload-control-upload span {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Remove the upload icon */
.upload-control-upload:before {
  display: none;
}

/* Submit Button */
input[type="submit"] {
  background: #FFB400;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;

}

input[type="submit"]:hover {
  background: #E6A200;
  transform: translateY(-2px);
 
}

input[type="submit"]:active {
  transform: translateY(0);
  
}

/* Hidden Elements */
input[type="text"][style*="display: none"],
input[type="text"][style*="opacity: 0"] {
  display: none !important;
}

/* Dark Mode Specific Adjustments */
[data-theme="dark"] .am-helpdesk-attachment-expand {
  color: #4dabf7;
}

[data-theme="dark"] .am-helpdesk-attachment-expand:hover {
  background: #4dabf7;
  color: white;
}

[data-theme="dark"] .upload-control-upload {
  background: #4dabf7;
}

[data-theme="dark"] .upload-control-upload:hover {
  background: #339af0;
}

/* Responsive */
@media (max-width: 768px) {
  .upload-control-upload {
    padding: 0.75rem 1.25rem;
  }
  
  input[type="submit"] {
    width: 100%;
    padding: 0.875rem;
  }
}
/* Success Message Container */
.container-xxl h1 {
  color: #28a745;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  text-align: center;
}

.container-xxl h1:before {
  content: '✅';
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

/* Success Message Text */
.container-xxl p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  text-align: center;
}

.container-xxl p:first-of-type {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Reference Number Link */

.container-xxl .link {
  color: #007bff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(0, 123, 255, 0.1);
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.container-xxl .link:hover {
  background: #007bff;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .container-xxl h1 {
  color: #51cf66;
}

[data-theme="dark"] .container-xxl .link {
  color: #4dabf7;
  background: rgba(77, 171, 247, 0.15);
}

[data-theme="dark"] .container-xxl .link:hover {
  background: #4dabf7;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .container-xxl h1 {
    font-size: 1.5rem;
  }
  
  .container-xxl p {
    font-size: 0.95rem;
  }
  
}
/* Ticket Container */
.am-helpdesk {
  max-width: 900px;
  margin: 0 auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

/* Ticket Header */
.am-helpdesk-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--info-bg);
  border-bottom: 1px solid var(--border-color);
}

.am-helpdesk-ticket-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.am-helpdesk-ticket-info strong {
  color: var(--text-primary);
}

/* Actions Container */
.am-helpdesk-ticket-actions-container {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.am-helpdesk-ticket-actions {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.am-helpdesk-ticket-action a {
  padding: 0.5rem 1rem;
  background: var(--info-bg);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.am-helpdesk-ticket-action a:hover {
  background: #007bff;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* Message Container */
.am-helpdesk-message {
  border-bottom: 1px solid var(--border-color);
}

.am-helpdesk-message:last-child {
  border-bottom: none;
}

/* Message Header */
.am-helpdesk-message-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--info-bg);
  font-size: 14px;
  color: var(--text-secondary);
}

.am-helpdesk-message-action-fold a {
  background: var(--text-muted);
  color: white;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  text-decoration: none;
  font-size: 12px;
  margin-right: 1rem;
}

.am-helpdesk-message-has-attachments img {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

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

.am-helpdesk-message-date {
  color: var(--text-muted);
  font-size: 13px;
}

.am-helpdesk-message-preview {
  color: var(--text-muted);
  font-style: italic;
}

/* Message Content */
.am-helpdesk-message-content {
  padding: 1.5rem;
}

.am-helpdesk-message-content pre {
  background: var(--info-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.am-helpdesk-message-content img {
  border-radius: 8px;
  margin: 0.5rem 0;
  box-shadow: 0 2px 8px var(--shadow-color);
}

/* Attachments */
.am-helpdesk-message-attachments {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.am-helpdesk-message-attachments-item {
  background: var(--info-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.am-helpdesk-message-attachments-item a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.am-helpdesk-message-attachments-item a:hover {
  color: #0056b3;
}

/* Reply Panel */
.am-helpdesk-reply-panel {
  padding: 1rem 1.5rem;
  background: var(--hover-bg);
  border-top: 1px solid var(--border-color);
}

.am-helpdesk-reply-panel-tools {
  margin-bottom: 1rem;
}

.am-helpdesk-reply-panel-tool-emoji {
  display: flex;
  gap: 0.5rem;
}

.am-helpdesk-reply-panel-tool-emoji-item {
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.am-helpdesk-reply-panel-tool-emoji-item:hover {
  background: var(--card-bg);
  transform: scale(1.1);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .am-helpdesk-ticket-action a:hover {
  background: #4dabf7;
  color: white;
}

[data-theme="dark"] .am-helpdesk-message-attachments-item a {
  color: #4dabf7;
}

[data-theme="dark"] .am-helpdesk-message-attachments-item a:hover {
  color: #74c0fc;
}

/* Responsive */
@media (max-width: 768px) {
  .am-helpdesk {
    margin: 0 1rem;
    border-radius: 8px;
  }
  
  .am-helpdesk-ticket-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .am-helpdesk-ticket-header,
  .am-helpdesk-message-header,
  .am-helpdesk-message-content,
  .am-helpdesk-reply-panel {
    padding: 1rem;
  }
  
  .am-helpdesk-reply-panel-tool-emoji {
    flex-wrap: wrap;
  }
}


/* Affiliate Banner Preview Container */
.am-aff-banner-preview {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.am-aff-banner-preview:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px var(--shadow-hover);
}

/* Copy to Clipboard Text */
.am-copy-to-clipboard {
  flex: 1;
  background: var(--info-bg);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  word-break: break-all;
  user-select: all;
  cursor: text;
}

/* Copy Button */
.am-copy-to-clipboard-trigger {
  background: #FFB400;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.am-copy-to-clipboard-trigger:hover {
  background: #E6A200;
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.am-copy-to-clipboard-trigger:before {
  content: '📋';
  margin-right: 0.5rem;
}

.am-copy-to-clipboard-trigger:after {
  content: 'Copy';
}

/* Success state after copying */
.am-copy-to-clipboard-trigger.copied {
  background: #28a745;
  color: white;
}

.am-copy-to-clipboard-trigger.copied:before {
  content: '✅';
}

.am-copy-to-clipboard-trigger.copied:after {
  content: 'Copied!';
}

/* Dark Mode Adjustments */
[data-theme="dark"] .am-copy-to-clipboard-trigger {
  background: #4dabf7;
}

[data-theme="dark"] .am-copy-to-clipboard-trigger:hover {
  background: #339af0;
}

[data-theme="dark"] .am-copy-to-clipboard-trigger.copied {
  background: #51cf66;
}

/* Responsive */
@media (max-width: 768px) {
  .am-aff-banner-preview {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .am-copy-to-clipboard {
    font-size: 13px;
    padding: 0.6rem 0.8rem;
  }
  
  .am-copy-to-clipboard-trigger {
    width: 100%;
  }
  
  .container-xxl h2 {
    font-size: 1.25rem;
  }
}
/* Affiliate Stats Table Container */
.am-grid-container {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow-color);
  margin: 1.5rem 0;
}

/* Table Styling */
.am-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card-bg);
}

/* Table Header */
.am-grid th {
  background: var(--info-bg);
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.am-grid th[style*="text-align:right"] {
  text-align: right;
}

/* Table Rows */
.am-grid-row td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--card-bg);
  transition: background-color 0.3s ease;
}

.am-grid-row:hover td {
  background: var(--hover-bg);
}

/* Right aligned cells */
.am-grid-row td[style*="text-align:right"] {
  text-align: right;
  font-weight: 500;
}

/* Commission amount styling */
.am-grid-row td:nth-child(2) {
  color: #28a745;
  font-weight: 600;
}

/* Total row styling */
.am-grid-row[style*="font-weight: bold"] td {
  background: var(--info-bg);
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--border-color);
  border-bottom: none;
}

.am-grid-row[style*="font-weight: bold"] td:nth-child(2) {
  color: #007bff;
  font-size: 1.1em;
}

/* Detail row (expandable) */
.am-grid-row[id*="detail-"] td {
  background: var(--hover-bg);
  padding: 1.5rem;
}

.am-grid-row[id*="detail-"] .detail-close {
  background: #dc3545;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.am-grid-row[id*="detail-"] .detail-close:hover {
  background: #c82333;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* Empty state styling */
.am-grid-row td:contains("–") {
  color: var(--text-muted);
  font-style: italic;
}

/* Zero amount styling */
.am-grid-row td:contains("0.00") {
  color: var(--text-muted);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .am-grid-row[style*="font-weight: bold"] td:nth-child(2) {
  color: #4dabf7;
}

[data-theme="dark"] .am-grid-row td:nth-child(2) {
  color: #51cf66;
}

[data-theme="dark"] .am-grid-row[id*="detail-"] .detail-close {
  background: #fa5252;
}

[data-theme="dark"] .am-grid-row[id*="detail-"] .detail-close:hover {
  background: #e03131;
}

/* Responsive */
@media (max-width: 768px) {
  .am-grid th,
  .am-grid-row td {
    padding: 0.75rem 0.5rem;
    font-size: 13px;
  }
  
  .am-grid th:first-child,
  .am-grid-row td:first-child {
    padding-left: 1rem;
  }
  
  .am-grid th:last-child,
  .am-grid-row td:last-child {
    padding-right: 1rem;
  }
}

@media (max-width: 576px) {
  .am-grid-container {
    margin: 1rem 0;
    border-radius: 8px;
  }
  
  .am-grid th,
  .am-grid-row td {
    padding: 0.6rem 0.4rem;
    font-size: 12px;
  }
}
/* Chart Container */
div[id*="report-"] {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1rem;
  margin: 1.5rem 0;
  box-shadow: var(--glass-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

div[id*="report-"]:hover {
  box-shadow: 0 6px 16px var(--shadow-hover);
  transform: translateY(-2px);
}



/* Chart Text Elements */
div[id*="report-"] svg text {
  fill: var(--text-muted) !important;
  font-family: inherit !important;
  font-size: 12px !important;
}

/* Chart Grid Lines */
div[id*="report-"] svg path[stroke="#aaaaaa"] {
  stroke: var(--border-color) !important;
  stroke-width: 0.5 !important;
}

/* Chart Data Points */
div[id*="report-"] svg circle {
  stroke: var(--card-bg) !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Morris Hover Tooltip */
.morris-hover {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 20px var(--shadow-hover) !important;
  padding: 0.75rem !important;
  font-family: inherit !important;
  font-size: 13px !important;
  z-index: 9999 !important;
  position: fixed !important;
}

.morris-hover.morris-default-style {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
}

/* Hover Row Label */
.morris-hover-row-label {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  margin-bottom: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-size: 14px !important;
}

/* Hover Point Data */
.morris-hover-point {
  color: var(--text-secondary) !important;
  margin: 0.25rem 0 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.morris-hover-point:before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Color-specific styling for different metrics */
.morris-hover-point[style*="#4da74d"]:before {
  background: #4da74d !important;
}

.morris-hover-point[style*="#21005d"]:before {
  background: #21005d !important;
}

.morris-hover-point[style*="#edc240"]:before {
  background: #edc240 !important;
}

.morris-hover-point[style*="#7A92A3"]:before,
.morris-hover-point[style*="#7a92a3"]:before {
  background: #7A92A3 !important;
}

/* Dark Mode Adjustments */
[data-theme="dark"] div[id*="report-"] svg text {
  fill: var(--text-muted) !important;
}

[data-theme="dark"] div[id*="report-"] svg path[stroke="#aaaaaa"] {
  stroke: var(--border-color) !important;
}

[data-theme="dark"] div[id*="report-"] svg circle {
  stroke: var(--card-bg) !important;
}

/* Chart Title (if added) */
div[id*="report-"]:before {
  content: attr(data-title);
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 16px;
  text-align: center;
}

/* Loading State */
div[id*="report-"].loading {
  background: var(--hover-bg);
  position: relative;
}

div[id*="report-"].loading:after {
  content: 'Loading chart...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  div[id*="report-"] {
    margin: 1rem 0;
    padding: 0.75rem;
    border-radius: 8px;
  }
  
  .morris-hover {
    font-size: 12px !important;
    padding: 0.5rem !important;
  }
  
  .morris-hover-row-label {
    font-size: 13px !important;
  }
  
  .morris-hover-point {
    font-size: 12px !important;
  }
}

@media (max-width: 576px) {
  div[id*="report-"] {
    height: 200px !important;
  }
  
  div[id*="report-"] svg {
    height: 200px !important;
  }
}
/* Export Stats Container */
.am-aff-stats-export {
  margin: 1.5rem 0;
  text-align: center;
}

/* Export Button */
.am-aff-stats-export-report {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #007bff;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
  border: none;
  cursor: pointer;
}

.am-aff-stats-export-report:hover {
  background: #0056b3;
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.am-aff-stats-export-report:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Download Icon */
.am-aff-stats-export-report:before {
  content: '📊';
  font-size: 16px;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .am-aff-stats-export-report {
  background: #4dabf7;
  box-shadow: 0 2px 4px rgba(77, 171, 247, 0.3);
}

[data-theme="dark"] .am-aff-stats-export-report:hover {
  background: #339af0;
  box-shadow: 0 4px 8px rgba(77, 171, 247, 0.4);
}

[data-theme="dark"] .am-aff-stats-export-report:active {
  box-shadow: 0 2px 4px rgba(77, 171, 247, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .am-aff-stats-export {
    margin: 1rem 0;
  }
  
  .am-aff-stats-export-report {
    padding: 0.6rem 1.25rem;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .am-aff-stats-export-report {
    width: 100%;
    justify-content: center;
  }
}
/* No Data Block */
.am-block-nodata {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 16px;
  font-style: italic;
}

/* Hide old emoji icon — we use HugeIcons inside the template now */
.am-block-nodata:before {
  display: none;
}

/* Redesigned empty state */
.am-block-nodata .nodata-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
}
.am-block-nodata .nodata-icon-wrap i {
  font-size: 1.75rem;
  color: #6366f1;
}
.am-block-nodata .nodata-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  font-style: normal;
}
.am-block-nodata .nodata-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto 1.25rem;
  font-style: normal;
}
.am-block-nodata .nodata-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff !important;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.am-block-nodata .nodata-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.3);
}
.am-block-nodata .nodata-cta i {
  font-size: 0.95rem;
}

[data-theme="dark"] .am-block-nodata .nodata-icon-wrap {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.06));
}

/* TICKET NOTIFY */

.am-info-helpdesk {
    background: var(--glass-bg);
    color: #155724;
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0;
}

.am-info-helpdesk a {
    color: #0b5138;
    text-decoration: underline;
    font-weight: 600;
}





/* Paragraphs */
.container-xxl p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}


/* Keywords List */
.am-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.am-list li {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  line-height: 1.5;
}

.am-list li:last-child {
  margin-bottom: 0;
}

/* List Item Labels */
.am-list li i {
  color: var(--text-primary);
  font-weight: 600;
  font-style: normal;
  display: block;
  margin-bottom: 0.5rem;
}

/* Affiliate Links */
.am-list li:not(:first-child) {
  font-family: 'Courier New', monospace;
  word-break: break-all;
  background: var(--hover-bg);
}

/* Keyword Highlight */
.am-list b {
  background: #FFB400;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}

/* First List Item (Base Link) */
.am-list li:first-child {
  background: rgba(255, 180, 0, 0.1);
  border-color: #FFB400;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .am-block-nodata {
  border-color: var(--border-color);
}

[data-theme="dark"] .am-list b {
  background: #FFCC44;
  color: #0f172a;
}

[data-theme="dark"] .am-list li:first-child {
  background: rgba(255, 180, 0, 0.15);
  border-color: #FFCC44;
}

/* Responsive */
@media (max-width: 768px) {
  .container-xxl > div:last-child {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  .am-block-nodata {
    padding: 1.5rem;
    font-size: 15px;
  }
  
  .am-block-nodata .nodata-icon-wrap {
    width: 60px;
    height: 60px;
  }
  
  .container-xxl h2 {
    font-size: 1.25rem;
  }
  
  .am-list {
    padding: 1rem;
  }
  
  .am-list li {
    padding: 0.6rem;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .container-xxl p {
    font-size: 14px;
  }
  
  .am-list li {
    font-size: 12px;
  }
}
.am-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.am-pagination a,
.am-pagination span {
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  background-color: #f2f2f2;
  transition: background 0.2s ease;
  border: 1px solid #ddd;
}

.am-pagination a:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: #1a2340;
}

.am-pagination .am-pagination-current {
  background-color: #4F46E5; /* Indigo */
  color: white;
  font-weight: 600;
  border: none;
}
.am-footer-content-wrapper {
  /* Glassmorphism effect */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin: 20px;
}

.am-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

/* For better text visibility on glassmorphism */
.am-credits, .am-footer-sm a {
  color: rgba(86, 86, 86, 1);
}

/* Optional hover effect for social links */
.am-footer-sm a:hover {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

/* ── Sendpass Success/Error Result Card ── */
.sendpass-result-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 2rem 1rem;
}
.sendpass-result-card {
    width: 100%;
    max-width: 520px;
    background: var(--glass-bg, rgba(255,255,255,0.6));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--glass-border, rgba(255,255,255,0.8));
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(100,130,200,0.08);
}
.sendpass-result-icon-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sendpass-result-icon-wrap i {
    font-size: 2.25rem;
}
.sendpass-result-icon-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04));
}
.sendpass-result-icon-success i {
    color: #10b981;
}
.sendpass-result-icon-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(239,68,68,0.05));
}
.sendpass-result-icon-error i {
    color: #ef4444;
}
.sendpass-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #1a2340);
    margin-bottom: 0.75rem;
}
.sendpass-result-desc {
    font-size: 0.95rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.7;
    margin-bottom: 2rem;
}
.sendpass-result-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.02em;
}
.sendpass-result-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
    color: #fff !important;
    text-decoration: none !important;
}
.sendpass-result-cta i {
    font-size: 1.1rem;
}

/* Dark mode */
[data-theme="dark"] .sendpass-result-card {
    background: var(--glass-bg, rgba(30,41,59,0.7));
    border-color: var(--glass-border, rgba(255,255,255,0.08));
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
[data-theme="dark"] .sendpass-result-icon-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.06));
}
[data-theme="dark"] .sendpass-result-icon-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.08));
}

@media (max-width: 640px) {
    .sendpass-result-card { padding: 2rem 1.5rem; border-radius: 20px; }
    .sendpass-result-icon-wrap { width: 72px; height: 72px; }
    .sendpass-result-icon-wrap i { font-size: 1.75rem; }
    .sendpass-result-title { font-size: 1.25rem; }
    .sendpass-result-cta { width: 100%; justify-content: center; }
}
