<reasoning_content>
*   Goal: Implement priority-based job scheduling for a queue.
    *   Functionality:
        1. `add_job(name, data, priority=0)`: Add job with priority.
        2. `get_next_job()`: Retrieve the highest priority job.
    *   Prioritization rules:
        1. Higher priority value = higher priority (Critical=2, High=1, Normal=0). Wait, looking at the example: "Returns critical job first". Critical is 2. So higher value = higher priority.
        2. Same priority = FIFO (First-In, First-Out).
    *   Data Structure: A Priority Queue (Heap) is standard for this. However, Python's `heapq` is a *min-heap*.
    *   Strategy: To turn a min-heap into a max-heap for priorities, I can store the priority as a negative number.
    *   FIFO management: To maintain FIFO for equal priorities, I need a counter/sequence number.
    *   `heapq` entries: `(priority_value, sequence_number, job_name, job_data)`.

    *   Class: `JobQueue`.
    *   Storage: A list `self._queue` used with `heapq`.
    *   Counter: `self._counter = 0`.
    *   `add_job(name, data, priority=0)`:
        *   Since it's a min-heap and we want high values first, store priority as `-priority`.
        *   `heapq.heappush(self._queue, (-priority, self._counter, name, data))`
        *   Increment `self._counter`.
    *   `get_next_job()`:
        *   If `self._queue` is empty, return `None`.
        *   `heapq.heappop(self._queue)`.
        *   Return `(name, data)`.

    *   `priority=2` (Critical) should come out before `priority=1` (High).
    *   If I use `-priority`, `-2` is smaller than `-1`. `heapq` pops the smallest value. This works perfectly.

    *   Need `import heapq`.

    ```python
    import heapq

    class JobQueue:
        def __init__(self):
            self._queue = []
            self._counter = 0

        def add_job(self, name: str, data: dict, priority: int = 0):
            # Use -priority to simulate a max-heap using heapq's min-heap
            # Use self._counter to ensure FIFO for identical priorities
            heapq.heappush(self._queue, (-priority, self._counter, name, data))
            self._counter += 1

        def get_next_job(self) -> tuple[str, dict] | None:
            if not self._queue:
                return None
            priority_neg, counter, name, data = heapq.heappop(self._queue)
            return (name, data)
    ```

    *   `add_job` accepts optional priority? Yes.
    *   Higher priority first? Yes (Critical=2, High=1, Normal=0).
    *   FIFO for same priority? Yes, via `self._counter`.
    *   `get_next_job` signature correct? Yes.

    Wait, let's double check the priority values in the prompt:
    0: Normal
    1: High
    2: Critical
    The example shows `critical` (priority 2) coming out first.
    Using `-priority` in a min-heap:
    -2 < -1 < 0.
    Smallest value pops first.
    So `-2` pops before `-1`.
    Correct.
</reasoning_content>

<content>
```python
import heapq

class JobQueue:
    def __init__(self):
        self._queue = []
        self._counter = 0

    def add_job(self, name: str, data: dict, priority: int = 0):
        # We use -priority because heapq is a min-heap, 
        # and we want higher priority numbers to be processed first.
        # self._counter ensures FIFO order for jobs with the same priority.
        heapq.heappush(self._queue, (-priority, self._counter, name, data))
        self._counter += 1

    def get_next_job(self) -> tuple[str, dict] | None:
        if not self._queue:
            return None
        
        _, _, name, data = heapq.heappop(self._queue)
        return (name, data)
```
</content>