diff --git a/Docs/Tasks.md b/Docs/Tasks.md
index 697ae92..d95a2c2 100644
--- a/Docs/Tasks.md
+++ b/Docs/Tasks.md
@@ -4,97 +4,160 @@ This document breaks the entire BanGUI project into development stages, ordered
---
-## Task 1 — Move "Configuration" to the Last Position in the Sidebar ✅ DONE
+## Task 3 — Fix Transparent Pie Chart Slices and Match Legend Label Colors to Slice Colors
-**Summary:** Moved the `Configuration` entry in `NAV_ITEMS` to the last position in `frontend/src/layouts/MainLayout.tsx`.
+### Root Cause
-**File:** `frontend/src/layouts/MainLayout.tsx`
+The pie chart slices appear transparent because `resolveFluentToken` in `frontend/src/utils/chartTheme.ts` fails to resolve Fluent UI CSS custom properties. It calls `getComputedStyle(document.documentElement)` — but `document.documentElement` is the `` element, and Fluent UI v9's `FluentProvider` injects its CSS custom properties on its own wrapper `
`, **not** on `` or `:root`. Therefore:
-The `NAV_ITEMS` array (around line 183) defines the sidebar menu order. Currently the order is: Dashboard, World Map, Jails, **Configuration**, History, Blocklists. Move the Configuration entry so it is the **last** element in the array. The resulting order must be:
+1. `getComputedStyle(document.documentElement).getPropertyValue('--colorPaletteBlueBorderActive')` returns `""` (empty string).
+2. `resolveFluentToken` falls back to returning the raw token string, e.g. `"var(--colorPaletteBlueBorderActive)"`.
+3. Recharts internally parses colour values for SVG rendering and animation interpolation. It cannot parse a `var(...)` reference so the SVG `fill` attribute ends up transparent/unset.
-1. Dashboard
-2. World Map
-3. Jails
-4. History
-5. Blocklists
-6. Configuration
+This affects **all four chart components** — `TopCountriesPieChart`, `TopCountriesBarChart`, `BanTrendChart`, and `JailDistributionChart` — since they all call `resolveFluentToken`. However the pie chart is the most visually obvious case because its slices have no fallback colour.
-Only the position in the array changes. Do not modify the label, path, or icon of any item.
+### Fix
+
+**File:** `frontend/src/utils/chartTheme.ts` — `resolveFluentToken` function (around line 30)
+
+Change the element passed to `getComputedStyle` from `document.documentElement` to the FluentProvider's wrapper element. The FluentProvider wrapper always has the CSS class `fui-FluentProvider` (this is a stable class name defined in `@fluentui/react-provider`). Query for it with `document.querySelector`:
+
+```typescript
+export function resolveFluentToken(tokenValue: string): string {
+ const match = /var\((--[^,)]+)/.exec(tokenValue);
+ if (match == null || match[1] == null) return tokenValue;
+
+ // FluentProvider injects CSS custom properties on its own wrapper
,
+ // not on :root. Query that element so we resolve actual colour values.
+ const el =
+ document.querySelector(".fui-FluentProvider") ?? document.documentElement;
+ const resolved = getComputedStyle(el)
+ .getPropertyValue(match[1])
+ .trim();
+ return resolved !== "" ? resolved : tokenValue;
+}
+```
+
+This is the **only change needed** in this file. Do not modify `CHART_PALETTE` or any other export.
+
+### Verification
+
+After applying the fix above:
+
+- Open the Dashboard page in the browser.
+- The pie chart slices must be filled with the palette colours (blue, red, green, gold, purple).
+- The bar chart, area chart, and jail distribution chart should also display their colours correctly.
+- The legend labels next to the pie chart must have the same font colour as their corresponding slice (this was already implemented by the previous agent in `TopCountriesPieChart.tsx` via the `legendFormatter` that wraps text in a ``). Since `entry.color` comes from the Recharts payload which reads the Cell `fill`, once the fill values are real hex strings the legend colours will also be correct.
+
+### What NOT to change
+
+- Do **not** modify `TopCountriesPieChart.tsx` — the `legendFormatter` changes already applied there are correct and will work once colours resolve properly.
+- Do **not** modify `CHART_PALETTE` or switch from Fluent tokens to hard-coded hex values — the token-based approach is correct; only the resolution target element was wrong.
+- Do **not** add refs or hooks to individual chart components — the single-line fix in `resolveFluentToken` is sufficient.
---
-## Task 2 — Auto-Recovery When Jail Activation Fails ✅ DONE
+## Task 4 — Merge Global Tab into Server Tab (Remove Duplicates)
-**Summary:** Added `recovered: bool | None` field to `JailActivationResponse` model. Implemented `_restore_local_file_sync` and `_rollback_activation_async` helpers. Updated `activate_jail` to back up the original `.local` file, roll back on any post-write failure (reload error, health-check failure, or jail not starting), and return `recovered=True/False`. Updated `ActivateJailDialog.tsx` to show warning/critical banners based on the `recovered` field. Added 3 new backend tests covering all rollback scenarios.
-
-**Context:** When a user activates a jail via `POST /api/config/jails/{name}/activate`, the backend writes `enabled = true` to `jail.d/{name}.local` and then reloads fail2ban. If the new configuration is invalid or the server crashes after reload, fail2ban stays broken and all jails go offline. The system must automatically recover by rolling back the change and restarting fail2ban.
-
-### Backend Changes
-
-**File:** `backend/app/services/config_file_service.py` — `activate_jail()` method (around line 1086)
-
-Wrap the reload-and-verify sequence in error handling that performs a rollback on failure:
-
-1. **Before writing** the `.local` override file, check whether a `.local` file for that jail already exists. If it does, read and keep its content in memory as a backup. If it does not exist, remember that no file existed.
-2. **Write** the override file with `enabled = true` (existing logic).
-3. **Reload** fail2ban via `jail_service.reload_all()` (existing logic).
-4. **Health-check / verify** that fail2ban is responsive and the jail appears in the active list (existing logic).
-5. **If any step after the write fails** (reload error, health-check timeout, jail not appearing):
- - **Rollback the config**: restore the original `.local` file content (or delete the file if it did not exist before).
- - **Restart fail2ban**: call `jail_service.reload_all()` again so fail2ban recovers with the old configuration.
- - **Health-check again** to confirm fail2ban is back.
- - Return an appropriate error response (HTTP 502 or 500) with a message that explains the activation failed **and** the system was recovered. Include a field `recovered: true` in the JSON body so the frontend can display a recovery notice.
-6. If rollback itself fails, return an error with `recovered: false` so the frontend can display a critical alert.
-
-**File:** `backend/app/routers/config.py` — `activate_jail` endpoint (around line 584)
-
-Propagate the `recovered` field in the error response. No extra logic is needed in the router if the service already raises an appropriate exception or returns a result object with the recovery status.
-
-### Frontend Changes
-
-**File:** `frontend/src/components/config/JailsTab.tsx` (or wherever the activate mutation result is handled)
-
-When the activation API call returns an error:
-- If `recovered` is `true`, show a warning banner/toast: *"Activation of jail '{name}' failed. The server has been automatically recovered."*
-- If `recovered` is `false`, show a critical error banner/toast: *"Activation of jail '{name}' failed and automatic recovery was unsuccessful. Manual intervention is required."*
-
-### Tests
-
-Add or extend tests in `backend/tests/test_services/test_config_file_service.py`:
-
-- **test_activate_jail_rollback_on_reload_failure**: Mock `jail_service.reload_all()` to raise on the first call (activation reload) and succeed on the second call (recovery reload). Assert the `.local` file is restored to its original content and the response indicates `recovered: true`.
-- **test_activate_jail_rollback_on_health_check_failure**: Mock the health check to fail after reload. Assert rollback and recovery.
-- **test_activate_jail_rollback_failure**: Mock both the activation reload and the recovery reload to fail. Assert the response indicates `recovered: false`.
-
----
-
-## Task 3 — Match Pie Chart Slice Colors to Country Label Font Colors ✅ DONE
-
-**Summary:** Updated `legendFormatter` in `TopCountriesPieChart.tsx` to return `React.ReactNode` instead of `string`, using `` to colour each legend label to match its pie slice. Imported `LegendPayload` from `recharts/types/component/DefaultLegendContent`.
-
-**Context:** The dashboard's Top Countries pie chart (`frontend/src/components/TopCountriesPieChart.tsx`) uses a color palette from `frontend/src/utils/chartTheme.ts` for the pie slices. The country names displayed in the legend next to the chart currently use the default text color. They should instead use the **same color as their corresponding pie slice**.
+The Global tab (`frontend/src/components/config/GlobalTab.tsx`) and the Server tab (`frontend/src/components/config/ServerTab.tsx`) both expose the same four editable fields: **Log Level**, **Log Target**, **DB Purge Age**, and **DB Max Matches**. The server tab additionally shows read-only **DB Path** and **Syslog Socket** fields, plus a **Flush Logs** button. Having both tabs is confusing and can cause conflicting writes.
### Changes
-**File:** `frontend/src/components/TopCountriesPieChart.tsx`
+1. **Remove the Global tab entirely.**
+ - In `frontend/src/pages/ConfigPage.tsx`:
+ - Remove `"global"` from the `TabValue` union type.
+ - Remove the `Global` element from the ``.
+ - Remove the `{tab === "global" && }` conditional render.
+ - Remove the `GlobalTab` import.
+ - In the barrel export file (`frontend/src/components/config/index.ts`): remove the `GlobalTab` re-export.
+ - Delete the file `frontend/src/components/config/GlobalTab.tsx`.
-In the `