<?php
function tenant_condition()
{
    if (!isset($_SESSION['user'])) return '';
    if ($_SESSION['user']['role'] === 'superadmin') return '';
    $orgId = $_SESSION['user']['org_id'] ?? 0;
    return " AND org_id=".(int)$orgId;
}
