:root {
            --primary: #2563eb; 
            --primary-hover: #1d4ed8; 
            --secondary: #4f46e5;
            --bg-body: #f8fafc; 
            --bg-surface: #ffffff; 
            --text-main: #0f172a; 
            --text-muted: #64748b; 
            --border: #e2e8f0;
            --success: #10b981; 
            --danger: #ef4444; 
            --warning: #f59e0b;
            
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
            --shadow-lg: 0 12px 24px rgba(0,0,0,0.08);
            --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            --radius-md: 16px;
            --radius-lg: 24px;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-tap-highlight-color: transparent; }
        body { background-color: var(--bg-body); color: var(--text-main); min-height: 100vh; overflow-x: hidden; scroll-behavior: smooth; }
        
        h1, h2, h3, h4 { font-weight: 800; color: #0f172a; margin: 0; }
        
        /* Buttons */
        .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: var(--transition); border: none; outline: none; text-decoration: none; }
        .btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); }
        .btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); box-shadow: var(--shadow-sm); }
        .btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f0fdf4; }
        .btn-success { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
        .btn-success:hover { transform: translateY(-2px); }
        .btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
        .btn-danger:hover { background: var(--danger); color: white; border-color: var(--danger); transform: translateY(-2px); }
        .btn-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
        .btn-warning:hover { background: var(--warning); color: white; border-color: var(--warning); transform: translateY(-2px); }
        
        /* Modern Inputs */
        .form-group { margin-bottom: 20px; text-align: left; }
        .form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: #475569; }
        .form-input, .form-select, .form-textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; outline: none; background: #f8fafc; font-size: 15px; transition: var(--transition); color: var(--text-main); font-weight: 500; }
        .form-input:focus, .form-textarea:focus, .form-select:focus { background: white; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235, 0.1); }

        /* Unified Auth Card (Standalone) */
        .auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--bg-body); }
        .auth-card { background: white; width: 100%; max-width: 440px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
        .auth-header { background: linear-gradient(135deg, #1e3a8a, var(--primary)); padding: 40px 30px; text-align: center; color: white; position: relative; }
        .auth-body { padding: 30px; }
        .tab-btns { display: flex; background: #f1f5f9; padding: 6px; border-radius: 14px; margin-bottom: 25px; }
        .tab-btn { flex: 1; text-align: center; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
        .tab-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

        /* ========= DASHBOARD UI ========= */
        .app-container { display: flex; height: 100vh; overflow: hidden; background: var(--bg-body); }
        
        /* Sidebar */
        .sidebar { width: 280px; background: white; display: flex; flex-direction: column; z-index: 1000; border-right: 1px solid var(--border); transition: 0.3s; }
        .sidebar-brand { padding: 30px 25px; font-size: 24px; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap:12px; border-bottom: 1px solid var(--border); margin-bottom: 15px; }
        .sidebar-brand i { color: var(--primary); font-size: 32px; }
        
        .nav-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--text-muted); font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.2s; margin: 4px 20px; border-radius: 12px; }
        .nav-item i { font-size: 22px; }
        .nav-item:hover { color: var(--primary); background: #f8fafc; }
        .nav-item.active { color: var(--primary); background: #eff6ff; }
        
        .main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; position: relative; }
        
        /* Header */
        .top-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 35px; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top:0; z-index: 100; }
        .header-left { display: flex; align-items: center; gap: 15px; }
        .header-right { display: flex; align-items: center; position: relative; gap: 15px; }
        
        .user-chip { display: flex; align-items: center; gap: 10px; background: white; padding: 6px 16px 6px 6px; border-radius: 30px; border: 1px solid var(--border); cursor: pointer; font-weight: 700; font-size: 14px; }
        .user-chip .avatar { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

        .dropdown-menu { position: absolute; top: 60px; right: 0; background: white; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 16px; width: 240px; padding: 10px; display: none; opacity: 0; transform: translateY(-10px); transition: 0.2s; z-index: 1000; }
        .dropdown-menu.active { display: block; opacity: 1; transform: translateY(0); }
        .dd-item { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: var(--text-main); font-size: 14.5px; font-weight: 600; cursor: pointer; border-radius: 10px; transition: 0.2s; }
        .dd-item i { font-size: 20px; color: var(--text-muted); }
        .dd-item:hover { background: #f8fafc; color: var(--primary); }
        .dd-item:hover i { color: var(--primary); }
        
        /* Panels */
        .panel { display: none; padding: 35px; animation: fadeIn 0.3s ease; max-width: 1400px; margin: 0 auto; width: 100%; }
        .panel.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .card { background: white; padding: 25px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); margin-bottom: 25px; transition: var(--transition); border: 1px solid var(--border); }
        
        /* Grid System */
        .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
        .span-2 { grid-column: span 2; }

        /* New Sub-Tabs for CP */
        .cp-tabs { display: flex; gap: 10px; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; overflow-x: auto; white-space: nowrap; }
        .cp-tab-btn { padding: 10px 20px; font-weight: 700; border-radius: 10px; cursor: pointer; color: var(--text-muted); transition: 0.2s; background: white; border: 1px solid transparent; }
        .cp-tab-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(37,99,235,0.3); }
        .cp-tab-content { display: none; animation: fadeIn 0.3s ease; }
        .cp-tab-content.active { display: block; }
        
        /* Profile specific */
        .profile-header-card { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: var(--radius-lg); padding: 40px; color: white; display: flex; align-items: center; gap: 25px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(37,99,235,0.3); }
        .profile-avatar { width: 90px; height: 90px; border-radius: 50%; background: white; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; border: 4px solid rgba(255,255,255,0.3); }
        
        .progress-bar { width: 100%; height: 8px; background: #e2e8f0; border-radius: 10px; overflow: hidden; margin-top: 10px; }
        .progress-fill { height: 100%; background: var(--primary); border-radius: 10px; transition: width 0.5s ease; }

        /* Bot Cards */
        .bot-list { display: grid; gap: 15px; }
        .bot-item { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-radius: 16px; background: white; box-shadow: var(--shadow-sm); border: 1px solid var(--border); flex-wrap: wrap; gap: 15px; transition: 0.2s; }
        .bot-item:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; transform: translateY(-2px); }
        .bot-avatar { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: white; font-size: 26px; }
        .bot-link { color: var(--primary); font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; background: #eff6ff; padding: 6px 12px; border-radius: 8px; margin-top:5px; }
        .badge { padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }

        /* Shop Grid */
        .grid-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }

        /* Tables */
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14.5px; }
        th { background: #f8fafc; color: var(--text-muted); font-weight: 800; text-transform: uppercase; font-size: 12px; }

        /* Mobile Bottom Nav */
        .bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); box-shadow: 0 -4px 15px rgba(0,0,0,0.05); border-top: 1px solid var(--border); z-index: 1000; padding: 10px 15px; padding-bottom: max(10px, env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
        .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-muted); cursor: pointer; transition: 0.2s; flex: 1; }
        .bn-item i { font-size: 24px; transition: 0.2s; }
        .bn-item span { font-size: 11px; font-weight: 700; }
        .bn-item.active { color: var(--primary); }
        .bn-item.active i { background: #eff6ff; padding: 5px 18px; border-radius: 20px; margin-bottom: 1px; color: var(--primary); }

        /* Editor Modal Overlay */
        .modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 9999; opacity: 0; transition: 0.3s; padding: 20px; }
        .modal-overlay.active { display: flex; opacity: 1; }
        
        .mobile-only { display: none !important; }
        
        @media (max-width: 768px) {
            .mobile-only { display: flex !important; }
            .desktop-only { display: none !important; }
            .sidebar { display: none; }
            .bottom-nav { display: flex; }
            .main-content { padding-bottom: 80px; } 
            .top-header { padding: 15px 20px; }
            .panel { padding: 20px 15px; }
            .grid-3 { grid-template-columns: 1fr; }
            .span-2 { grid-column: span 1; }
            .profile-header-card { flex-direction: column; text-align: center; padding: 30px 20px; }
        }
