<div class="section-card">
    <div class="section-title">⚙️ Advanced Settings</div>
    <div class="row g-2">
        <div class="col-md-6">
            <div class="form-check small mb-1">
                <input class="form-check-input" type="checkbox" id="advAudit">
                <label class="form-check-label" for="advAudit">Enable Audit Trail</label>
            </div>
            <label class="form-label small mb-1">Audit Table</label>
            <input type="text" class="form-control form-control-sm" id="advAuditTable" placeholder="audit_log">
        </div>
        <div class="col-md-6">
            <div class="form-check small mb-1">
                <input class="form-check-input" type="checkbox" id="advLocking">
                <label class="form-check-label" for="advLocking">Record Locking</label>
            </div>
            <label class="form-label small mb-1">Lock Table</label>
            <input type="text" class="form-control form-control-sm" id="advLockTable" placeholder="record_locks">
        </div>
        <div class="col-md-6">
            <label class="form-label small mb-1">Lock Timeout (seconds)</label>
            <input type="number" class="form-control form-control-sm" id="advLockTimeout" value="300">
        </div>
        <div class="col-md-6">
            <label class="form-label small mb-1">Export Watermark</label>
            <input type="text" class="form-control form-control-sm" id="advWatermark" placeholder="Confidential">
        </div>
        <div class="col-12">
            <div class="form-text small text-muted">
                <i class="bi bi-info-circle"></i> Session timeout, lifetime and concurrent-session limits
                are configured in <strong>Security &rarr; Session Control</strong>.
            </div>
        </div>
    </div>

    <div class="col-12 mt-3">
        <hr class="my-2">
        <h6 class="small mb-2">🕐 Default Date/Time</h6>
        <div class="row g-2">
            <div class="col-md-6">
                <label class="form-label small mb-1" for="advTimezone">Project Timezone</label>
                <div class="adv-tz-row">
                <select class="form-select form-select-sm" id="advTimezone">
                    <option value="">System default (UTC)</option>
                    <?php
                    $__zones = [];
                    foreach (\DateTimeZone::listIdentifiers() as $__z) {
                        $__slash  = strpos($__z, '/');
                        $__region = $__slash !== false ? substr($__z, 0, $__slash) : 'Other';
                        $__zones[$__region][] = $__z;
                    }
                    ksort($__zones);
                    foreach ($__zones as $__region => $__list) {
                        echo '<optgroup label="' . htmlspecialchars($__region) . '">';
                        foreach ($__list as $__z) {
                            echo '<option value="' . htmlspecialchars($__z) . '">'
                                . htmlspecialchars(str_replace('_', ' ', $__z)) . '</option>';
                        }
                        echo '</optgroup>';
                    }
                    ?>
                </select>
                <span class="adv-tz-info" id="advTzInfo" title="Current UTC offset and local time in the selected timezone"></span>
                </div>
            </div>
            <div class="col-12">
                <div class="form-text small text-muted">
                    <i class="bi bi-info-circle"></i> Sets the timezone the entire generated app runs on
                    (all date/time display and storage). Applied on the next <strong>Build</strong>.
                </div>
            </div>
        </div>
    </div>

    <div class="col-12 mt-3">
        <hr class="my-2">
        <h6 class="small mb-2">📬 Notifications</h6>
        <div class="form-check small">
            <input class="form-check-input" type="checkbox" id="notifEnableCheck">
            <label class="form-check-label" for="notifEnableCheck">Enable Notifications</label>
        </div>
        <div id="notifFields" style="display:none; margin-top:0.5rem;">
            <div class="row g-2">
                <div class="col-md-4">
                    <label class="form-label small mb-1">Table Name</label>
                    <input type="text" class="form-control form-control-sm" id="notifTableName" placeholder="notifications" disabled>
                </div>
            </div>
        </div>
    </div>

</div>