
        :root {
            /* Default light theme colors based on user's exact config */
            --bg-main: #f8f9ff;
            --bg-sidebar: #e5eeff;
            --bg-card: #ffffff;
            --border-color: #c4c5d5;
            --text-primary: #0b1c30;
            --text-secondary: #444653;
            --primary-color: #00288e; /* Deep navy blue */
            --primary-hover: #1e40af;
            --accent-color: #f2711c;
            --success-color: #10b981;
            --danger-color: #ba1a1a; /* Deep red */
            --card-shadow: 0 4px 20px -2px rgba(11, 28, 48, 0.1);
        }

        body.dark-theme {
            /* Dark mode colors */
            --bg-main: #0b0f19;
            --bg-sidebar: #111827;
            --bg-card: rgba(20, 27, 45, 0.7);
            --border-color: rgba(255, 255, 255, 0.06);
            --text-primary: #f3f4f6;
            --text-secondary: #9ca3af;
            --primary-color: #00cec9; /* Vibrant Cyan */
            --primary-hover: #00b5ad;
            --accent-color: #f2711c;
            --success-color: #10b981;
            --danger-color: #ef4444;
            --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--bg-main);
            color: var(--text-primary);
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            transition: background-color 0.3s, color 0.3s;
        }

        /* Sidebar styling */
        .sidebar {
            position: fixed;
            top: 0;
            right: 0;
            width: 280px;
            height: 100vh;
            background-color: var(--bg-sidebar);
            border-left: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            padding: 24px 16px;
            box-sizing: border-box;
            z-index: 100;
            transition: all 0.3s ease;
        }
        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 32px;
        }
        .sidebar-logo-icon {
            width: 40px;
            height: 40px;
            background-color: rgba(0, 40, 142, 0.08);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
        }
        body.dark-theme .sidebar-logo-icon {
            background-color: rgba(0, 206, 201, 0.1);
        }
        .sidebar-logo-icon span {
            font-size: 24px;
        }
        .logo-text h1 {
            font-size: 18px;
            margin: 0;
            font-weight: 700;
            color: var(--primary-color);
        }
        .logo-text p {
            font-size: 9px;
            margin: 0;
            letter-spacing: 1px;
            color: var(--text-secondary);
            text-transform: uppercase;
        }
        .sidebar-menu {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .sidebar-btn {
            display: flex;
            align-items: center;
            gap: 16px;
            width: 100%;
            padding: 12px 16px;
            background: none;
            border: none;
            color: var(--text-secondary);
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            text-align: right;
            transition: all 0.2s ease;
            box-sizing: border-box;
        }
        .sidebar-btn span.material-symbols-outlined {
            font-size: 20px;
        }
        .sidebar-btn:hover {
            background-color: rgba(0, 0, 0, 0.03);
            color: var(--text-primary);
        }
        body.dark-theme .sidebar-btn:hover {
            background-color: rgba(255, 255, 255, 0.03);
        }
        .sidebar-btn.active {
            background-color: rgba(0, 40, 142, 0.06);
            color: var(--primary-color);
            border-right: 4px solid var(--primary-color);
            font-weight: 700;
        }
        body.dark-theme .sidebar-btn.active {
            background-color: rgba(0, 206, 201, 0.1);
        }

        /* Main content layout */
        .main-content {
            margin-right: 280px;
            min-height: 100vh;
            box-sizing: border-box;
            transition: all 0.3s ease;
        }

        /* Sidebar collapsed state */
        .sidebar.collapsed {
            transform: translateX(280px);
        }
        html[dir="ltr"] .sidebar.collapsed {
            transform: translateX(-280px);
        }
        .main-content.sidebar-collapsed {
            margin-right: 0 !important;
            margin-left: 0 !important;
        }
        .btn-toggle-sidebar {
            background: none;
            border: none;
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8px;
            border-radius: 8px;
            transition: background-color 0.2s;
            margin-left: 8px;
        }
        html[dir="ltr"] .btn-toggle-sidebar {
            margin-left: 0;
            margin-right: 8px;
        }
        .btn-toggle-sidebar:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }
        body.dark-theme .btn-toggle-sidebar:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        /* Top Header */
        .header {
            height: 64px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 40px;
            background-color: var(--bg-sidebar);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 50;
        }
        /* Modern SaaS Workspace / App Switcher */
        .app-switcher {
            position: relative;
        }
        .app-switcher-trigger {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 6px 14px 6px 8px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            min-width: 220px;
            max-width: 280px;
            user-select: none;
        }
        .app-switcher-trigger:hover {
            border-color: var(--primary-color);
            box-shadow: 0 6px 16px rgba(0, 40, 142, 0.09);
            transform: translateY(-1px);
        }
        body.dark-theme .app-switcher-trigger:hover {
            box-shadow: 0 6px 16px rgba(0, 206, 201, 0.16);
        }
        .app-switcher-avatar {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: linear-gradient(135deg, rgba(0, 40, 142, 0.08), rgba(0, 40, 142, 0.18));
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 700;
            flex-shrink: 0;
            overflow: hidden;
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        }
        body.dark-theme .app-switcher-avatar {
            background: linear-gradient(135deg, rgba(0, 206, 201, 0.15), rgba(0, 206, 201, 0.25));
        }
        .app-switcher-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .app-switcher-info {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            flex: 1;
            text-align: right;
        }
        html[dir="ltr"] .app-switcher-info {
            text-align: left;
        }
        .app-switcher-subtitle {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            line-height: 1.1;
        }
        .app-switcher-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
            margin-top: 1px;
        }
        .app-switcher-chevron {
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s ease;
        }
        .app-switcher.open .app-switcher-chevron {
            transform: rotate(180deg);
        }
        .app-switcher-dropdown {
            position: absolute;
            top: 56px;
            right: 0;
            width: 320px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
            z-index: 1000;
            display: none;
            overflow: hidden;
            animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }
        html[dir="ltr"] .app-switcher-dropdown {
            right: auto;
            left: 0;
        }
        .app-switcher-dropdown.show {
            display: block;
        }
        @keyframes dropdownSlideIn {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .app-search-box {
            padding: 10px 12px;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .app-search-input {
            width: 100%;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            border-radius: 8px;
            padding: 7px 10px;
            font-size: 12px;
            color: var(--text-primary);
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }
        .app-search-input:focus {
            border-color: var(--primary-color);
        }
        .app-switcher-list {
            max-height: 260px;
            overflow-y: auto;
            padding: 6px;
        }
        .app-switcher-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.15s ease;
            position: relative;
            margin-bottom: 2px;
        }
        .app-switcher-item:hover {
            background: rgba(0, 40, 142, 0.05);
        }
        body.dark-theme .app-switcher-item:hover {
            background: rgba(0, 206, 201, 0.1);
        }
        .app-switcher-item.selected {
            background: rgba(0, 40, 142, 0.08);
            border: 1px solid rgba(0, 40, 142, 0.2);
        }
        body.dark-theme .app-switcher-item.selected {
            background: rgba(0, 206, 201, 0.15);
            border: 1px solid rgba(0, 206, 201, 0.3);
        }
        .app-switcher-item-avatar {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: var(--bg-main);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            font-weight: 700;
            overflow: hidden;
            flex-shrink: 0;
        }
        .app-switcher-item-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .app-switcher-item-info {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            flex: 1;
            text-align: right;
        }
        html[dir="ltr"] .app-switcher-item-info {
            text-align: left;
        }
        .app-switcher-item-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .app-switcher-item-pkg {
            font-size: 11px;
            color: var(--text-secondary);
            font-family: monospace;
            direction: ltr;
            text-align: right;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        html[dir="ltr"] .app-switcher-item-pkg {
            text-align: left;
        }
        .app-switcher-check {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--primary-color);
            color: var(--bg-main);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            flex-shrink: 0;
        }
        .app-switcher-footer {
            padding: 8px 12px;
            border-top: 1px solid var(--border-color);
            background: var(--bg-main);
            display: flex;
            justify-content: center;
        }
        .btn-add-app-shortcut {
            width: 100%;
            padding: 8px;
            border-radius: 8px;
            border: 1px dashed var(--border-color);
            background: var(--bg-card);
            color: var(--primary-color);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.15s ease;
        }
        .btn-add-app-shortcut:hover {
            border-color: var(--primary-color);
            background: rgba(0, 40, 142, 0.04);
        }
        body.dark-theme .btn-add-app-shortcut:hover {
            background: rgba(0, 206, 201, 0.08);
        }
        .icon-upload-action-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .btn-upload-icon {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            border-radius: 8px;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            height: 38px;
            transition: all 0.2s ease;
        }
        .btn-upload-icon:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background-color: rgba(0, 40, 142, 0.04);
        }
        body.dark-theme .btn-upload-icon:hover {
            background-color: rgba(0, 206, 201, 0.1);
        }
        .icon-picker-box {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px;
            background: var(--bg-main);
            border: 1px dashed var(--border-color);
            border-radius: 10px;
            margin-top: 6px;
        }
        .icon-preview-box {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: 700;
            overflow: hidden;
            flex-shrink: 0;
            box-shadow: 0 2px 6px rgba(0,0,0,0.05);
            cursor: pointer;
        }
        .icon-preview-box img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .icon-preset-container {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .preset-btn {
            padding: 4px 8px;
            border-radius: 14px;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            font-size: 11px;
            font-weight: 600;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.15s;
        }
        .preset-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }
        .table-app-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: var(--bg-main);
            border: 1px solid var(--border-color);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            font-weight: bold;
            overflow: hidden;
            vertical-align: middle;
        }
        .table-app-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .header-actions {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .btn-refresh {
            background-color: var(--primary-color);
            border: none;
            color: var(--bg-main);
            font-weight: 700;
            font-size: 13px;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .btn-refresh:hover {
            opacity: 0.9;
        }

        /* Avatar dropdown popup wrapper */
        .avatar-container {
            position: relative;
        }
        .profile-img {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            border: 2px solid var(--primary-color);
            cursor: pointer;
            transition: transform 0.2s;
            background-color: var(--bg-card);
            color: var(--text-primary);
            padding: 6px;
            box-sizing: border-box;
        }
        .profile-img:hover {
            transform: scale(1.05);
        }

        /* Settings Dropdown Popover on Avatar click */
        .profile-dropdown {
            position: absolute;
            top: 48px;
            left: 0;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            display: none;
            min-width: 220px;
            z-index: 1000;
            box-sizing: border-box;
        }
        .profile-dropdown.show {
            display: block;
        }
        .dropdown-header {
            font-size: 11px;
            color: var(--text-secondary);
            font-weight: 700;
            margin-bottom: 12px;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 8px;
            text-transform: uppercase;
        }
        .dropdown-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            margin-bottom: 10px;
            color: var(--text-primary);
        }
        .dropdown-select {
            background-color: var(--bg-main);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 11px;
            outline: none;
            cursor: pointer;
        }

        /* Container padding */
        .container {
            padding: 40px;
            max-width: 1300px;
            margin: 0 auto;
            box-sizing: border-box;
        }

        /* Tab Content Panel hiding */
        .tab-panel {
            display: none;
        }
        .tab-panel.active {
            display: block;
        }

        /* Dashboard Overview Grid */
        .welcome-row {
            margin-bottom: 32px;
        }
        .welcome-row h2 {
            font-size: 28px;
            margin: 0 0 8px 0;
            color: var(--text-primary);
        }
        .welcome-row p {
            font-size: 14px;
            color: var(--text-secondary);
            margin: 0;
        }
        .kpi-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
            margin-bottom: 32px;
        }
        .kpi-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 20px;
            min-height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            box-shadow: var(--card-shadow);
            position: relative;
            overflow: hidden;
            box-sizing: border-box;
        }
        .kpi-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }
        .kpi-card-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .kpi-card-icon span {
            font-size: 20px;
        }
        .kpi-card-body {
            margin-top: 16px;
        }
        .kpi-card-title {
            font-size: 11px;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }
        .kpi-card-value {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
        }

        /* Bento row 2 */
        .overview-row2 {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 24px;
        }
        .panel-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 24px;
            box-shadow: var(--card-shadow);
            box-sizing: border-box;
        }
        .panel-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 20px 0;
        }

        /* Distribution Chart */
        .progress-track {
            height: 18px;
            width: 100%;
            background-color: rgba(0, 0, 0, 0.05);
            border-radius: 20px;
            display: flex;
            overflow: hidden;
            margin-top: 16px;
        }
        body.dark-theme .progress-track {
            background-color: rgba(255, 255, 255, 0.05);
        }
        .progress-fill {
            height: 100%;
            transition: width 0.6s ease;
        }
        .progress-fill.store { background-color: var(--success-color); }
        .progress-fill.redirect { background-color: #fbbf24; }
        .share-labels {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            margin-top: 12px;
        }
        .share-labels .store { color: var(--success-color); font-weight: 600; }
        .share-labels .redirect { color: #fbbf24; font-weight: 600; }

        /* Guide Card style */
        .guide-box {
            background: linear-gradient(135deg, rgba(0, 40, 142, 0.08), rgba(0, 206, 201, 0.05));
            position: relative;
            overflow: hidden;
        }
        body.dark-theme .guide-box {
            background: linear-gradient(135deg, rgba(14, 35, 64, 0.8), rgba(0, 206, 201, 0.15));
        }
        .guide-icon-wrap {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background-color: rgba(0, 40, 142, 0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 16px;
            color: var(--primary-color);
        }
        body.dark-theme .guide-icon-wrap {
            background-color: rgba(255, 255, 255, 0.1);
            color: white;
        }
        .guide-icon-wrap span {
            font-size: 24px;
        }
        .guide-box h4 {
            font-size: 16px;
            margin: 0 0 8px 0;
            color: var(--text-primary);
        }
        .guide-box p {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.6;
            margin: 0 0 24px 0;
        }
        .btn-action-primary {
            width: 100%;
            padding: 12px;
            background-color: var(--primary-color);
            border: none;
            border-radius: 8px;
            color: var(--bg-main);
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s;
        }
        .btn-action-primary:hover {
            opacity: 0.9;
        }

        /* Glassmorphic Link Builder Card Matching Photo */
        .glass-builder-card {
            max-width: 500px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.65);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(0, 40, 142, 0.08);
            border-radius: 16px;
            padding: 28px;
            box-shadow: 0 20px 40px rgba(11, 28, 48, 0.12);
            position: relative;
        }
        body.dark-theme .glass-builder-card {
            background: rgba(30, 41, 59, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        }
        .glass-builder-card h3 {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 20px 0;
            text-align: center;
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-group label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }
        .select-input-styled {
            width: 100%;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            border-radius: 8px;
            padding: 10px 14px;
            font-size: 13px;
            outline: none;
            box-sizing: border-box;
            cursor: pointer;
        }
        .input-styled {
            width: 100%;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            border-radius: 8px;
            padding: 11px 14px;
            font-size: 13px;
            box-sizing: border-box;
            outline: none;
            transition: all 0.2s;
        }
        .input-styled:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.15);
        }

        /* Inline horizontal alignment box */
        .flex-row-align {
            display: flex;
            gap: 16px;
            align-items: flex-end;
        }
        .flex-row-align .input-wrap {
            flex-grow: 1;
        }
        .toggle-container {
            background-color: rgba(0, 0, 0, 0.02);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0 16px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-width: 180px;
            box-sizing: border-box;
        }
        body.dark-theme .toggle-container {
            background-color: rgba(255, 255, 255, 0.04);
        }
        .toggle-container span {
            font-size: 12px;
            color: var(--text-primary);
            font-weight: 500;
        }

        /* Custom Switch Toggle */
        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: #cbd5e1;
            transition: .3s;
            border-radius: 24px;
        }
        body.dark-theme .slider {
            background-color: #4b5563;
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
        }
        input:checked + .slider {
            background-color: var(--primary-color);
        }
        input:checked + .slider:before {
            transform: translateX(20px);
        }

        /* Cyan generate button */
        .btn-generate {
            width: 100%;
            padding: 14px;
            background-color: var(--primary-color);
            border: none;
            border-radius: 8px;
            color: var(--bg-main);
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
        }
        .btn-generate:hover {
            opacity: 0.9;
        }

        /* Result container styling */
        .builder-result {
            margin-top: 24px;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 16px;
        }
        .result-head {
            font-size: 12px;
            color: var(--primary-color);
            font-weight: 700;
            margin-bottom: 8px;
        }
        .result-url-text {
            background-color: var(--bg-main);
            border: 1px solid var(--border-color);
            padding: 12px;
            border-radius: 8px;
            font-family: monospace;
            font-size: 12px;
            word-break: break-all;
            direction: ltr;
            text-align: left;
            margin-bottom: 12px;
            color: var(--text-primary);
        }
        .btn-copy-url {
            width: 100%;
            padding: 10px;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s;
        }
        .btn-copy-url:hover {
            border-color: var(--primary-color);
        }

        /* Beautiful Tables */
        .table-panel {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
        }
        .table-panel-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-color);
            background-color: rgba(0, 0, 0, 0.01);
        }
        .table-panel-header h4 {
            font-size: 16px;
            margin: 0;
            color: var(--text-primary);
        }
        .table-responsive {
            overflow-x: auto;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            text-align: right;
        }
        html[dir="ltr"] table {
            text-align: left;
        }
        html[dir="rtl"] table {
            text-align: right;
        }
        th {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 600;
            padding: 14px 20px;
            border-bottom: 1px solid var(--border-color);
            background-color: rgba(0, 0, 0, 0.02);
            text-align: inherit;
        }
        td {
            padding: 14px 20px;
            border-bottom: 1px solid var(--border-color);
            font-size: 13px;
            color: var(--text-primary);
            text-align: inherit;
            vertical-align: middle;
        }
        html[dir="ltr"] th, html[dir="ltr"] td {
            text-align: left;
        }
        html[dir="rtl"] th, html[dir="rtl"] td {
            text-align: right;
        }
        .center-text {
            text-align: center !important;
        }
        .left-text {
            text-align: left !important;
        }
        .right-text {
            text-align: right !important;
        }
        tr:hover td {
            background-color: rgba(0, 0, 0, 0.01);
        }

        /* Table Badges */
        .source-tag {
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            background-color: var(--bg-main);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
        }
        .type-badge {
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
        }
        .type-badge.s2s {
            background-color: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.25);
            color: #10b981;
        }
        .type-badge.redirect {
            background-color: rgba(251, 191, 36, 0.15);
            border: 1px solid rgba(251, 191, 36, 0.25);
            color: #d97706;
        }
        .font-mono-custom {
            font-family: monospace;
            color: var(--text-secondary);
        }

        /* Action Buttons */
        .btn-action-small {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: all 0.2s;
        }
        .btn-action-small:hover {
            color: var(--primary-color);
            background-color: rgba(0, 0, 0, 0.03);
        }
        .btn-action-small.delete:hover {
            color: var(--danger-color);
        }

        /* Create Grids (Split panel for Forms and Lists) */
        .grid-split {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 24px;
        }

        /* Toast Container */
        .toast-holder {
            position: fixed;
            bottom: 24px;
            left: 24px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .toast-msg {
            background-color: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.25);
            color: #10b981;
            padding: 12px 20px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: var(--card-shadow);
        }

        /* Utility classes */
        .center-text { text-align: center; }
        .left-text { text-align: left; }

        /* Offline SVG Styling */
        svg.icon-svg {
            display: inline-block;
            vertical-align: middle;
            width: 20px;
            height: 20px;
            transition: transform 0.2s;
        }
        .sidebar-logo-icon svg {
            color: var(--primary-color);
        }
        .btn-toggle-sidebar svg {
            color: var(--text-primary);
        }
        .dropdown-arrow {
            display: inline-block;
            vertical-align: middle;
            width: 14px;
            height: 14px;
            transition: transform 0.25s ease;
            color: var(--text-secondary);
        }
        .select-trigger:hover .dropdown-arrow {
            color: var(--primary-color);
        }
        .custom-select-trigger.active .dropdown-arrow {
            transform: rotate(180deg);
        }
        .btn-refresh svg {
            margin-left: 6px;
        }
        html[dir="ltr"] .btn-refresh svg {
            margin-left: 0;
            margin-right: 6px;
        }
        .sidebar-btn svg {
            margin-left: 0;
        }
        .btn-action-primary svg {
            margin-left: 8px;
        }
        html[dir="ltr"] .btn-action-primary svg {
            margin-left: 0;
            margin-right: 8px;
        }
        .btn-copy-url svg {
            margin-left: 8px;
        }
        html[dir="ltr"] .btn-copy-url svg {
            margin-left: 0;
            margin-right: 8px;
        }
        
        /* Modal Style rules */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
        }
        .modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }
        .modal-content {
            background: var(--bg-card);
            backdrop-filter: blur(14px);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            width: 100%;
            max-width: 440px;
            padding: 25px;
            box-shadow: 0 15px 40px rgba(0,0,0,0.15);
            transform: scale(0.9);
            transition: transform 0.3s;
        }
        .modal-overlay.active .modal-content {
            transform: scale(1);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 12px;
            margin-bottom: 18px;
        }
        .modal-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
        .btn-close-modal {
            background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); outline: none;
        }
        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }
        .btn-modal-action {
            height: 38px;
            padding: 0 16px;
            border-radius: 6px;
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }
        .btn-modal-action.save { background: var(--primary-color); color: var(--bg-main); }
        .btn-modal-action.save:hover { opacity: 0.9; }
        .btn-modal-action.cancel { background: rgba(0,0,0,0.05); color: var(--text-primary); }
        body.dark-theme .btn-modal-action.cancel { background: rgba(255,255,255,0.08); }
        .btn-modal-action.cancel:hover { opacity: 0.8; }

        /* Toast notifications container style */
        #toast-container {
            position: fixed;
            bottom: 30px;
            left: 30px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 99999;
        }
        .toast {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 12px 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.08);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            font-weight: 700;
            animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
            transition: all 0.3s;
        }
        .toast svg {
            width: 18px;
            height: 18px;
        }
        .toast.success { border-right: 4px solid var(--success-color); color: #10b981; }
        .toast.error { border-right: 4px solid var(--danger-color); color: #ef4444; }

        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        .empty-logs {
            text-align: center;
            padding: 40px;
            color: var(--text-secondary);
            font-style: italic;
        }
        
        /* Pagination bar styles */
        .pagination-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 24px;
            border-top: 1px solid var(--border-color);
            background-color: var(--bg-card);
            border-bottom-left-radius: 12px;
            border-bottom-right-radius: 12px;
        }
        .pagination-info {
            font-size: 13px;
            color: var(--text-secondary);
        }
        .pagination-buttons {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .btn-page {
            height: 32px;
            min-width: 32px;
            padding: 0 8px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background-color: var(--bg-card);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .btn-page:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background-color: rgba(0, 40, 142, 0.04);
        }
        body.dark-theme .btn-page:hover {
            background-color: rgba(0, 206, 201, 0.08);
            border-color: var(--primary-color);
            color: var(--primary-color);
        }
        .btn-page.active {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: var(--bg-main);
        }
        .btn-page:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            pointer-events: none;
        }
        
        .sort-indicator {
            font-size: 11px;
            margin-right: 4px;
            display: inline-block;
            vertical-align: middle;
        }
        html[dir="ltr"] .sort-indicator {
            margin-right: 0;
            margin-left: 4px;
        }
        
        /* Column Filter Popup Styles */
        .filter-popup {
            position: absolute;
            top: 100%;
            right: 0;
            left: auto;
            z-index: 1000;
            display: none;
            min-width: 180px;
            max-height: 250px;
            overflow-y: auto;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            padding: 8px 0;
            text-align: right;
        }
        html[dir="ltr"] .filter-popup {
            text-align: left;
            left: 0;
            right: auto;
        }
        .filter-popup.active {
            display: block;
        }
        .filter-option {
            padding: 8px 16px;
            font-size: 13px;
            color: var(--text-primary);
            cursor: pointer;
            transition: background 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .filter-option:hover {
            background: rgba(0, 40, 142, 0.05);
        }
        body.dark-theme .filter-option:hover {
            background: rgba(0, 206, 201, 0.08);
        }
        .filter-option.active {
            font-weight: 700;
            color: var(--primary-color);
            background: rgba(0, 40, 142, 0.04);
        }
        body.dark-theme .filter-option.active {
            background: rgba(0, 206, 201, 0.06);
        }
        .filter-icon {
            opacity: 0.5;
            transition: all 0.2s;
            display: inline-block;
            vertical-align: middle;
            margin-right: 6px;
        }
        html[dir="ltr"] .filter-icon {
            margin-right: 0;
            margin-left: 6px;
        }
        .filter-icon.active {
            opacity: 1;
            color: var(--accent-color);
            fill: var(--accent-color);
        }

        /* Campaign Table Specific Fixed Layout & Sizing */
        .campaigns-table {
            width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
        }
        .campaigns-table th, .campaigns-table td {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: normal;
            vertical-align: middle;
            box-sizing: border-box;
            padding: 14px 20px;
        }
        .campaigns-table .col-camp-name {
            width: 25%;
            word-break: break-word;
            padding-right: 15px;
        }
        html[dir="ltr"] .campaigns-table .col-camp-name {
            text-align: left !important;
        }
        html[dir="rtl"] .campaigns-table .col-camp-name {
            text-align: right !important;
        }
        .campaigns-table .col-pkg {
            width: 25%;
            word-break: break-all;
            font-family: monospace;
            direction: ltr;
            text-align: left !important;
            font-size: 12px;
            padding-left: 15px;
        }
        .campaigns-table .col-clicks {
            width: 11%;
            text-align: center !important;
        }
        .campaigns-table .col-store-clicks {
            width: 11%;
            text-align: center !important;
        }
        .campaigns-table .col-redirect-clicks {
            width: 11%;
            text-align: center !important;
        }
        .campaigns-table .col-last-active {
            width: 13%;
            font-family: monospace;
            font-size: 11px;
            direction: ltr;
            text-align: center !important;
        }
        .campaigns-table .col-actions {
            width: 70px;
            text-align: center !important;
            white-space: nowrap;
        }

        .badge-hidden {
            display: inline-block;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 4px;
            background: rgba(239, 68, 68, 0.12);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.25);
            margin-right: 6px;
        }
        html[dir="ltr"] .badge-hidden {
            margin-right: 0;
            margin-left: 6px;
        }
        tr.campaign-hidden-row {
            opacity: 0.65;
            background-color: rgba(0, 0, 0, 0.02);
        }
        body.dark-theme tr.campaign-hidden-row {
            background-color: rgba(255, 255, 255, 0.02);
        }
        .btn-toggle-hidden {
            padding: 6px 14px;
            border-radius: 8px;
            font-size: 12px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-primary);
            transition: all 0.2s ease;
        }
        .btn-toggle-hidden:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }
        .btn-toggle-hidden.active {
            background: var(--primary-color);
            color: var(--bg-main);
            border-color: var(--primary-color);
        }
        .link-url-cell {
            max-width: 320px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-family: monospace;
            font-size: 11px;
            direction: ltr;
            text-align: left;
        }

    
        /* User Header Profile Badge */
        .user-header-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border-color);
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 12px;
            margin-right: 12px;
        }
        .user-role-tag {
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 700;
            text-transform: uppercase;
        }
        .user-role-tag.admin {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
            border: 1px solid rgba(245, 158, 11, 0.3);
        }
        .user-role-tag.viewer {
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
            border: 1px solid rgba(59, 130, 246, 0.3);
        }
        .btn-logout {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 4px;
            display: flex;
            align-items: center;
            gap: 4px;
            border-radius: 6px;
            transition: all 0.2s;
            font-size: 11px;
        }
        .btn-logout:hover {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
        }

        /* Fullscreen Glassmorphism Login Overlay */
        .login-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: radial-gradient(circle at center, rgba(0, 40, 142, 0.25) 0%, rgba(11, 15, 25, 0.96) 100%), #0b0f19;
            backdrop-filter: blur(12px);
            z-index: 99999;
            display: none;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }
        .login-overlay.show { display: flex; }
        .login-card {
            width: 100%;
            max-width: 400px;
            background: rgba(18, 24, 38, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 206, 201, 0.15);
            border-radius: 20px;
            padding: 36px 32px;
            text-align: center;
            backdrop-filter: blur(20px);
        }
        .login-brand-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            background: linear-gradient(135deg, #00cec9, #00288e);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
            font-size: 26px;
            box-shadow: 0 8px 20px rgba(0, 206, 201, 0.3);
        }
        .login-card h2 {
            font-size: 20px;
            font-weight: 800;
            margin-bottom: 6px;
            color: #ffffff;
        }
        .login-card p {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 24px;
        }
        .login-form .form-group {
            text-align: right;
            margin-bottom: 16px;
        }
        .login-form label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 6px;
            color: #d1d5db;
        }
        .login-form input {
            background: rgba(11, 15, 25, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #ffffff;
        }
        .login-form input:focus {
            border-color: #00cec9;
            box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.2);
        }
        .login-error {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #ef4444;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 12px;
            margin-bottom: 16px;
            display: none;
            text-align: center;
        }
        .btn-login-submit {
            width: 100%;
            padding: 13px;
            background: linear-gradient(135deg, #00cec9, #00288e);
            border: none;
            border-radius: 10px;
            color: #ffffff;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
        }
        .btn-login-submit:hover {
            opacity: 0.95;
            transform: translateY(-1px);
        }
        /* Modal Scrollability and Display rules */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            overflow-y: auto !important;
            padding: 24px 12px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            box-sizing: border-box !important;
            z-index: 9999;
        }
        .modal-overlay.active, .modal-overlay.show {
            opacity: 1 !important;
            pointer-events: auto !important;
        }
        .modal-content {
            max-height: 88vh !important;
            overflow-y: auto !important;
            margin: auto !important;
            max-width: 520px !important;
            box-sizing: border-box !important;
        }
        .modal-overlay.active .modal-content, .modal-overlay.show .modal-content {
            transform: scale(1) !important;
        }
        .modal-content::-webkit-scrollbar {
            width: 6px;
        }
        .modal-content::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

    