divide the header frame in two frames. Upper header frame has the data label and the settings label. Lower Frame: has the fitlers. Python 3.12 code: class TableApp:
    """Table Editor with sidebar and table management."""

    def __init__(self, root: tk.Tk):
        """Initialize the TableApp."""
        self.root = root
        self.config_dimensions()
        self.config_fonts()
        self.config_colors()
        self.initialize_data()
        self.setup_ui()
        self.load_tables()

    def config_dimensions(self):
        """Configure app dimensions."""
        self.root.title("Database")
        self.root.geometry("1920x1080")
        self.root.minsize(1435, 910)
        self.sidebar_width = 400
        self.spacer_frame_width = 100
        self.header_height = 190
        self.separator_height = 1

    def config_fonts(self):
        """Configure app fonts."""
        font_name, font_size, font_style = "Literata", 12, "normal"
        self.default_font = (font_name, font_size, font_style)
        self.root.option_add("*Font", f"{font_name} {font_size}")
        self.header_info_font = ("Literata", 10)

    def config_colors(self):
        """Configure app colors."""
        self.text_color = "#333333"
        self.background_color = "#FFFFFF"
        self.sidebar_color = "#F7F8FC"
        self.button_color = "#F7F8FC"
        self.button_color_selected = "#EAEDEF"
        self.separator_color = '#333333'
        self.header_info_font_color = '#999999'

    def setup_ui(self):
        """Set up the user interface with a 3x2 grid layout."""
        self.root.grid_rowconfigure(0, weight=0)
        self.root.grid_rowconfigure(1, weight=1)

        self.root.grid_columnconfigure(0, weight=0)
        self.root.grid_columnconfigure(1, weight=0, minsize=self.spacer_frame_width)
        self.root.grid_columnconfigure(2, weight=3)

        self.create_sidebar()
        self.create_header_frame()
        self.create_spacer_frame()
        self.create_table_frame()

    def create_sidebar(self):
        """Create the sidebar that spans both rows."""
        sidebar = self._create_frame(
            parent=self.root,
            width=self.sidebar_width,
            bg=self.sidebar_color
        )
        sidebar.grid(row=0, column=0, rowspan=2, sticky='ns')
        sidebar.grid_propagate(False)
        sidebar.columnconfigure(0, weight=1)
        sidebar.rowconfigure(0, weight=1)

        functional_sidebar = self._create_frame(
            parent=sidebar,
            width=self.sidebar_width,
            bg=self.sidebar_color
        )
        functional_sidebar.grid(row=0, column=0, sticky='nsew')
        functional_sidebar.columnconfigure(0, weight=1)
        functional_sidebar.rowconfigure(0, weight=0)
        functional_sidebar.rowconfigure(1, weight=1)
        functional_sidebar.rowconfigure(2, weight=0)

        self._add_normal_buttons(functional_sidebar)
        self._add_scrollable_canvas(functional_sidebar)
        self._add_delete_table_section(functional_sidebar)

    def create_header_frame(self):
        """Create the header that spans columns 1 and 2 in row 0."""
        header_frame = self._create_frame(
            parent=self.root,
            width=None,
            bg=self.background_color
        )
        header_frame.grid(row=0, column=1, columnspan=2, sticky='ew')
        header_frame.config(height=self.header_height)
        header_frame.grid_propagate(False)
        
        header_frame.grid_rowconfigure(0, weight=0)
        header_frame.grid_rowconfigure(1, weight=0)
        
        header_frame.grid_columnconfigure(0, weight=0)
        header_frame.grid_columnconfigure(1, weight=0)
        header_frame.grid_columnconfigure(2, weight=0)
        header_frame.grid_columnconfigure(3, weight=0)
        header_frame.grid_columnconfigure(4, weight=1)
        
        data_label = tk.Label(
            header_frame,
            text="Data > ",
            bg=self.background_color,
            fg=self.header_info_font_color,
            font=self.header_info_font
        )
        data_label.grid(row=0, column=0, padx=24, pady=(24, 0), sticky='nw')
        
        self.table_name_label = tk.Label(
            header_frame,
            text=self.current_table_name if self.current_table_name else "No Table Selected",
            bg=self.background_color,
            fg=self.text_color,
            font=self.header_info_font
        )
        self.table_name_label.grid(row=0, column=0, padx=(90, 10), pady=(24, 0), sticky='nw')

        filter_label = tk.Label(
            header_frame,
            text="Filter: ",
            bg=self.background_color,
            fg=self.text_color
        )
        filter_label.grid(row=1, column=0, padx=(100, 0), pady=20, sticky='e')
              
        self.filter_header_dropdown = ttk.Combobox(
            header_frame,
            textvariable=self.filter_header_var,
            state="readonly",
            width=15
        )
        self.filter_header_dropdown['values'] = ["All"]
        self.filter_header_dropdown.grid(row=1, column=1, padx=0, pady=0, sticky='w')
        self.filter_header_dropdown.bind("<<ComboboxSelected>>", lambda _: self.apply_filter())
              
        self.filter_option_dropdown = ttk.Combobox(
            header_frame,
            textvariable=self.filter_option_var,
            state="readonly",
            width=15,
        )
        self.filter_option_dropdown['values'] = [
            "is", "is not", "contains", "does not contain",
            "starts with", "ends with", "is empty", "is not empty"
        ]
        self.filter_option_dropdown.grid(row=1, column=2, padx=0, pady=0, sticky='w')
        self.filter_option_dropdown.bind("<<ComboboxSelected>>", self.update_filter_text_state)
        
        self.filter_text_entry = tk.Entry(
            header_frame,
            textvariable=self.filter_text_var,
            fg=self.text_color,
            width=20
        )
        self.filter_text_entry.grid(row=1, column=3, padx=0, pady=0, sticky='w')
        self.filter_text_entry.bind("<KeyRelease>", lambda _: self.apply_filter())
        
        settings_label = tk.Label(
            header_frame,
            text="...",
            bg=self.background_color,
            fg=self.text_color,
            cursor="hand2",
            anchor='e'
        )
        settings_label.grid(row=0, column=4, padx=40, pady=20, sticky='e')
        
        settings_menu = tk.Menu(self.root, tearoff=0)
        settings_menu.add_command(label="Export Table", command=self.export_table)
        settings_menu.add_command(label="Import Table", command=self.import_file)
        settings_menu.add_command(label="Rename Headers", command=self.rename_headers)
        
        settings_label.bind("<Button-1>", lambda e: settings_menu.post(e.x_root, e.y_root))
        settings_label.bind("<Enter>", lambda _: settings_label.config(bg=self.button_color_selected))
        settings_label.bind("<Leave>", lambda _: settings_label.config(bg=self.background_color))

    def update_filter_text_state(self, event=None):
        """Enable or disable the filter text entry based on filter option."""
        option = self.filter_option_var.get()
        if option in ["is empty", "is not empty"]:
            self.filter_text_var.set("")
            self.filter_text_entry.config(state='disabled')
        else:
            self.filter_text_entry.config(state='normal')

    def create_spacer_frame(self):
        """Create a spacer frame in column 1, row 1."""
        spacer = self._create_frame(
            parent=self.root,
            width=self.spacer_frame_width,
            bg=self.background_color
        )
        spacer.grid(row=1, column=1, sticky='nsew')
        spacer.grid_propagate(False)

    def create_table_frame(self):
        """Create the table frame in column 2, row 1."""
        self.table_frame = self._create_frame(
            parent=self.root,
            width=None,
            bg=self.background_color
        )
        self.table_frame.grid(row=1, column=2, sticky='nsew')
        self.table_frame.grid_rowconfigure(0, weight=1)
        self.table_frame.grid_columnconfigure(0, weight=1)

    def _create_frame(
        self,
        parent: tk.Widget,
        width: Optional[int],
        bg: str
    ) -> tk.Frame:
        """Create a frame with specified width and background."""
        frame = tk.Frame(parent, width=width, bg=bg, bd=0, relief='flat')
        if width:
            frame.config(width=width)
        return frame

    def _add_normal_buttons(self, sidebar: tk.Frame):
        """Add buttons to the sidebar."""
        normal_buttons_frame = self._create_frame(
            parent=sidebar,
            width=self.sidebar_width,
            bg=self.sidebar_color
        )
        normal_buttons_frame.grid(row=0, column=0, sticky='ew', padx=10, pady=(10, 0))
        normal_buttons_frame.columnconfigure(0, weight=1)

        create_table_label = self._create_clickable_label(
            parent=normal_buttons_frame,
            text="Create New Table",
            command=self.create_new_table,
            anchor='center'
        )
        create_table_label.grid(row=0, column=0, pady=10, sticky='ew')
        self.add_custom_hover(create_table_label)

        separator = tk.Frame(normal_buttons_frame, height=self.separator_height, bg=self.separator_color)
        separator.grid(row=1, column=0, sticky='ew', pady=5)

    def _add_scrollable_canvas(self, sidebar: tk.Frame):
        """Add scrollable canvas for table labels within a single frame."""
        scrollable_container = self._create_frame(
            parent=sidebar,
            width=self.sidebar_width,
            bg=self.sidebar_color
        )
        scrollable_container.grid(row=1, column=0, sticky='nsew', padx=10, pady=10)
        scrollable_container.columnconfigure(0, weight=1)
        scrollable_container.rowconfigure(0, weight=1)
    
        self.canvas = tk.Canvas(
            scrollable_container,
            bg=self.sidebar_color,
            highlightthickness=0
        )
        self.canvas.grid(row=0, column=0, sticky='nsew')
    
        self.config_scrollbar_style()
    
        # Store the scrollbar as an instance variable
        self.scrollbar = ttk.Scrollbar(
            scrollable_container,
            orient="vertical",
            command=self.canvas.yview,
            style="Custom.Vertical.TScrollbar"
        )
        self.scrollbar.grid(row=0, column=1, sticky='ns')
    
        self.canvas.configure(yscrollcommand=self.scrollbar.set)
    
        self.table_labels_frame = tk.Frame(self.canvas, bg=self.sidebar_color)
        self.canvas.create_window((0, 0), window=self.table_labels_frame, anchor="nw")
    
        # Bind mouse wheel events
        self.canvas.bind("<MouseWheel>", self._on_mouse_wheel)
        self.table_labels_frame.bind("<MouseWheel>", self._on_mouse_wheel)
    
        # Update scrollregion and scrollbar visibility on content change
        self.table_labels_frame.bind(
            "<Configure>",
            lambda event: (
                self.canvas.configure(scrollregion=self.canvas.bbox("all")),
                self._update_scrollbar(scrollable_container, self.canvas, self.scrollbar)
            )
        )
        scrollable_container.bind(
            "<Configure>",
            lambda event: self._update_scrollbar(scrollable_container, self.canvas, self.scrollbar)
        )
    
    def _on_mouse_wheel(self, event):
        """Handle mouse wheel scrolling only if scrollbar is visible."""
        if self.scrollbar.winfo_viewable():
            self.canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")

    def _update_scrollbar(self, scrollbar_frame, canvas, scrollbar):
        """Update scrollbar visibility based on content size."""
        canvas.update_idletasks()
        canvas_height = scrollbar_frame.winfo_height()
        content_height = self.table_labels_frame.winfo_reqheight()

        if content_height > canvas_height:
            scrollbar.grid()
            canvas.configure(yscrollcommand=scrollbar.set)
            canvas.bind("<MouseWheel>", lambda event: canvas.yview_scroll(int(-1 * (event.delta / 120)), "units"))
        else:
            scrollbar.grid_remove()
            canvas.configure(yscrollcommand=lambda *args: None)
            canvas.unbind("<MouseWheel>")

    def _add_delete_table_section(self, sidebar: tk.Frame):
        """Add delete table option to the sidebar."""
        delete_table_frame = self._create_frame(
            parent=sidebar,
            width=self.sidebar_width,
            bg=self.sidebar_color
        )
        delete_table_frame.grid(row=2, column=0, sticky='ew', padx=10, pady=(0, 10))
        delete_table_frame.columnconfigure(0, weight=1)
        delete_table_frame.rowconfigure(1, weight=1)
    
        separator = tk.Frame(delete_table_frame, height=self.separator_height, bg=self.separator_color)
        separator.grid(row=0, column=0, sticky='ew', pady=5)
    
        delete_table_label = self._create_clickable_label(
            parent=delete_table_frame,
            text="🗑 Delete Selected Table",
            command=self.delete_table,
            anchor='center'
        )
        delete_table_label.grid(row=1, column=0, pady=10, sticky='ew')
        self.add_custom_hover(delete_table_label)

    def _create_clickable_label(
        self,
        parent: tk.Widget,
        text: str,
        command,
        allow_rename: bool = False,
        anchor: str = 'w'
    ) -> tk.Label:
        """Create a clickable label with optional rename functionality."""
        cursor = "arrow" if allow_rename else "hand2"
        label = tk.Label(
            parent,
            text=text,
            bg=self.button_color,
            fg=self.text_color,
            cursor=cursor,
            anchor=anchor
        )
        label.bind("<Button-1>", lambda _: command())
    
        if allow_rename:
            label.bind("<Double-Button-1>", lambda _: self.begin_rename(text))
    
        label.bind("<MouseWheel>", self._on_mouse_wheel)
    
        return label

    def add_custom_hover(self, widget: tk.Widget):
        """Add custom hover effects to a widget."""
        widget.bind("<Enter>", lambda e: widget.config(bg=self.button_color_selected))
        widget.bind("<Leave>", lambda e: widget.config(bg=self.button_color))
Only print the parts of the code that need to be changed